/**
*/
package satellite.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import satellite.Payload;
import satellite.SatellitePackage;
import satellite.Spacecraft;
/**
*
* An implementation of the model object 'Spacecraft'.
*
*
* The following features are implemented:
*
*
* - {@link satellite.impl.SpacecraftImpl#getPayload Payload}
*
*
* @generated
*/
public abstract class SpacecraftImpl extends CommunicatingElementImpl implements Spacecraft {
/**
* The cached value of the '{@link #getPayload() Payload}' containment reference.
*
*
* @see #getPayload()
* @generated
* @ordered
*/
protected Payload payload;
/**
*
*
* @generated
*/
protected SpacecraftImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return SatellitePackage.Literals.SPACECRAFT;
}
/**
*
*
* @generated
*/
@Override
public Payload getPayload() {
return payload;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetPayload(Payload newPayload, NotificationChain msgs) {
Payload oldPayload = payload;
payload = newPayload;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
SatellitePackage.SPACECRAFT__PAYLOAD, oldPayload, newPayload);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setPayload(Payload newPayload) {
if (newPayload != payload) {
NotificationChain msgs = null;
if (payload != null)
msgs = ((InternalEObject) payload).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - SatellitePackage.SPACECRAFT__PAYLOAD, null, msgs);
if (newPayload != null)
msgs = ((InternalEObject) newPayload).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - SatellitePackage.SPACECRAFT__PAYLOAD, null, msgs);
msgs = basicSetPayload(newPayload, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.SPACECRAFT__PAYLOAD, newPayload,
newPayload));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SatellitePackage.SPACECRAFT__PAYLOAD:
return basicSetPayload(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SatellitePackage.SPACECRAFT__PAYLOAD:
return getPayload();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SatellitePackage.SPACECRAFT__PAYLOAD:
setPayload((Payload) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SatellitePackage.SPACECRAFT__PAYLOAD:
setPayload((Payload) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SatellitePackage.SPACECRAFT__PAYLOAD:
return payload != null;
}
return super.eIsSet(featureID);
}
} //SpacecraftImpl