/** */ package satellite.impl; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; 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.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import satellite.ConstellationMission; import satellite.GroundStationNetwork; import satellite.SatellitePackage; import satellite.Spacecraft; /** * * An implementation of the model object 'Constellation Mission'. * *

* The following features are implemented: *

* * * @generated */ public abstract class ConstellationMissionImpl extends MinimalEObjectImpl.Container implements ConstellationMission { /** * The cached value of the '{@link #getGroundStationNetwork() Ground Station Network}' containment reference. * * * @see #getGroundStationNetwork() * @generated * @ordered */ protected GroundStationNetwork groundStationNetwork; /** * The cached value of the '{@link #getSpacecraft() Spacecraft}' containment reference list. * * * @see #getSpacecraft() * @generated * @ordered */ protected EList spacecraft; /** * * * @generated */ protected ConstellationMissionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SatellitePackage.Literals.CONSTELLATION_MISSION; } /** * * * @generated */ @Override public GroundStationNetwork getGroundStationNetwork() { return groundStationNetwork; } /** * * * @generated */ public NotificationChain basicSetGroundStationNetwork(GroundStationNetwork newGroundStationNetwork, NotificationChain msgs) { GroundStationNetwork oldGroundStationNetwork = groundStationNetwork; groundStationNetwork = newGroundStationNetwork; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, oldGroundStationNetwork, newGroundStationNetwork); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setGroundStationNetwork(GroundStationNetwork newGroundStationNetwork) { if (newGroundStationNetwork != groundStationNetwork) { NotificationChain msgs = null; if (groundStationNetwork != null) msgs = ((InternalEObject) groundStationNetwork).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, null, msgs); if (newGroundStationNetwork != null) msgs = ((InternalEObject) newGroundStationNetwork).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, null, msgs); msgs = basicSetGroundStationNetwork(newGroundStationNetwork, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, newGroundStationNetwork, newGroundStationNetwork)); } /** * * * @generated */ @Override public EList getSpacecraft() { if (spacecraft == null) { spacecraft = new EObjectContainmentEList(Spacecraft.class, this, SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT); } return spacecraft; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: return basicSetGroundStationNetwork(null, msgs); case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: return ((InternalEList) getSpacecraft()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: return getGroundStationNetwork(); case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: return getSpacecraft(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: setGroundStationNetwork((GroundStationNetwork) newValue); return; case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: getSpacecraft().clear(); getSpacecraft().addAll((Collection) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: setGroundStationNetwork((GroundStationNetwork) null); return; case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: getSpacecraft().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: return groundStationNetwork != null; case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: return spacecraft != null && !spacecraft.isEmpty(); } return super.eIsSet(featureID); } } //ConstellationMissionImpl