PrimitivePackageImpl.java
Go to the documentation of this file.
00001 
00003 package org.best.of.robotics.smachDSL.impl;
00004 
00005 import java.util.Collection;
00006 
00007 import org.best.of.robotics.smachDSL.PrimitivePackage;
00008 import org.best.of.robotics.smachDSL.SmachDSLPackage;
00009 import org.best.of.robotics.smachDSL.StateMachine;
00010 
00011 import org.eclipse.emf.common.notify.NotificationChain;
00012 
00013 import org.eclipse.emf.common.util.EList;
00014 
00015 import org.eclipse.emf.ecore.EClass;
00016 import org.eclipse.emf.ecore.InternalEObject;
00017 
00018 import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
00019 
00020 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
00021 import org.eclipse.emf.ecore.util.InternalEList;
00022 
00036 public class PrimitivePackageImpl extends MinimalEObjectImpl.Container implements PrimitivePackage
00037 {
00046   protected EList<StateMachine> statemachines;
00047 
00053   protected PrimitivePackageImpl()
00054   {
00055     super();
00056   }
00057 
00063   @Override
00064   protected EClass eStaticClass()
00065   {
00066     return SmachDSLPackage.Literals.PRIMITIVE_PACKAGE;
00067   }
00068 
00074   public EList<StateMachine> getStatemachines()
00075   {
00076     if (statemachines == null)
00077     {
00078       statemachines = new EObjectContainmentEList<StateMachine>(StateMachine.class, this, SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES);
00079     }
00080     return statemachines;
00081   }
00082 
00088   @Override
00089   public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
00090   {
00091     switch (featureID)
00092     {
00093       case SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES:
00094         return ((InternalEList<?>)getStatemachines()).basicRemove(otherEnd, msgs);
00095     }
00096     return super.eInverseRemove(otherEnd, featureID, msgs);
00097   }
00098 
00104   @Override
00105   public Object eGet(int featureID, boolean resolve, boolean coreType)
00106   {
00107     switch (featureID)
00108     {
00109       case SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES:
00110         return getStatemachines();
00111     }
00112     return super.eGet(featureID, resolve, coreType);
00113   }
00114 
00120   @SuppressWarnings("unchecked")
00121   @Override
00122   public void eSet(int featureID, Object newValue)
00123   {
00124     switch (featureID)
00125     {
00126       case SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES:
00127         getStatemachines().clear();
00128         getStatemachines().addAll((Collection<? extends StateMachine>)newValue);
00129         return;
00130     }
00131     super.eSet(featureID, newValue);
00132   }
00133 
00139   @Override
00140   public void eUnset(int featureID)
00141   {
00142     switch (featureID)
00143     {
00144       case SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES:
00145         getStatemachines().clear();
00146         return;
00147     }
00148     super.eUnset(featureID);
00149   }
00150 
00156   @Override
00157   public boolean eIsSet(int featureID)
00158   {
00159     switch (featureID)
00160     {
00161       case SmachDSLPackage.PRIMITIVE_PACKAGE__STATEMACHINES:
00162         return statemachines != null && !statemachines.isEmpty();
00163     }
00164     return super.eIsSet(featureID);
00165   }
00166 
00167 } //PrimitivePackageImpl


bride_plugin_source
Author(s): Alexander Bubeck
autogenerated on Sun Oct 5 2014 22:38:34