/******************************************************************************* * Copyright (c) 2010 Michal Antkiewicz. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Michal Antkiewicz - initial API and implementation ******************************************************************************/ /** * * * * $Id: AppletModelImpl.java,v 1.6 2007/12/06 03:28:30 Michal Antkiewicz <mantkiew@gsd.uwaterloo.ca> $ */ package ca.uwaterloo.gsd.applet.impl; import java.util.Collection; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import ca.uwaterloo.gsd.applet.Applet; import ca.uwaterloo.gsd.applet.AppletModel; import ca.uwaterloo.gsd.applet.AppletPackage; import ca.uwaterloo.gsd.fsml.fsml.impl.ConceptImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Model</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link ca.uwaterloo.gsd.applet.impl.AppletModelImpl#getApplets <em>Applets</em>}</li> * </ul> * </p> * * @generated */ public class AppletModelImpl extends ConceptImpl implements AppletModel { /** * The cached value of the '{@link #getApplets() <em>Applets</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getApplets() * @generated * @ordered */ protected EList<Applet> applets; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AppletModelImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return AppletPackage.Literals.APPLET_MODEL; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Applet> getApplets() { if (applets == null) { applets = new EObjectContainmentEList<Applet>(Applet.class, this, AppletPackage.APPLET_MODEL__APPLETS); } return applets; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AppletPackage.APPLET_MODEL__APPLETS: return ((InternalEList<?>)getApplets()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AppletPackage.APPLET_MODEL__APPLETS: return getApplets(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AppletPackage.APPLET_MODEL__APPLETS: getApplets().clear(); getApplets().addAll((Collection<? extends Applet>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case AppletPackage.APPLET_MODEL__APPLETS: getApplets().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case AppletPackage.APPLET_MODEL__APPLETS: return applets != null && !applets.isEmpty(); } return super.eIsSet(featureID); } } //AppletModelImpl