| /** | |
| * <copyright> | |
| * </copyright> | |
| * | |
| * $Id$ | |
| */ | |
| package statemachine.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 statemachine.CompositeState; | |
| import statemachine.Region; | |
| import statemachine.StatemachinePackage; | |
| /** | |
| * <!-- begin-user-doc --> | |
| * An implementation of the model object '<em><b>Composite State</b></em>'. | |
| * <!-- end-user-doc --> | |
| * <p> | |
| * The following features are implemented: | |
| * <ul> | |
| * <li>{@link statemachine.impl.CompositeStateImpl#getRegion <em>Region</em>}</li> | |
| * </ul> | |
| * </p> | |
| * | |
| * @generated | |
| */ | |
| public class CompositeStateImpl extends StateImpl implements CompositeState { | |
| /** | |
| * The cached value of the '{@link #getRegion() <em>Region</em>}' containment reference list. | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @see #getRegion() | |
| * @generated | |
| * @ordered | |
| */ | |
| protected EList region; | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| protected CompositeStateImpl() { | |
| super(); | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| protected EClass eStaticClass() { | |
| return StatemachinePackage.Literals.COMPOSITE_STATE; | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public EList getRegion() { | |
| if (region == null) { | |
| region = new EObjectContainmentEList(Region.class, this, StatemachinePackage.COMPOSITE_STATE__REGION); | |
| } | |
| return region; | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
| switch (featureID) { | |
| case StatemachinePackage.COMPOSITE_STATE__REGION: | |
| return ((InternalEList)getRegion()).basicRemove(otherEnd, msgs); | |
| } | |
| return super.eInverseRemove(otherEnd, featureID, msgs); | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
| switch (featureID) { | |
| case StatemachinePackage.COMPOSITE_STATE__REGION: | |
| return getRegion(); | |
| } | |
| return super.eGet(featureID, resolve, coreType); | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public void eSet(int featureID, Object newValue) { | |
| switch (featureID) { | |
| case StatemachinePackage.COMPOSITE_STATE__REGION: | |
| getRegion().clear(); | |
| getRegion().addAll((Collection)newValue); | |
| return; | |
| } | |
| super.eSet(featureID, newValue); | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public void eUnset(int featureID) { | |
| switch (featureID) { | |
| case StatemachinePackage.COMPOSITE_STATE__REGION: | |
| getRegion().clear(); | |
| return; | |
| } | |
| super.eUnset(featureID); | |
| } | |
| /** | |
| * <!-- begin-user-doc --> | |
| * <!-- end-user-doc --> | |
| * @generated | |
| */ | |
| public boolean eIsSet(int featureID) { | |
| switch (featureID) { | |
| case StatemachinePackage.COMPOSITE_STATE__REGION: | |
| return region != null && !region.isEmpty(); | |
| } | |
| return super.eIsSet(featureID); | |
| } | |
| } //CompositeStateImpl |