/**
*/
package ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl;
import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FAMTerminator;
import ca.mcgill.ecse.dslreasoner.standalone.test.fam.FunctionalData;
import ca.mcgill.ecse.dslreasoner.standalone.test.fam.famPackage;
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 org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
/**
*
* An implementation of the model object 'FAM Terminator'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FAMTerminatorImpl#getData Data}
*
*
* @generated
*/
public class FAMTerminatorImpl extends MinimalEObjectImpl.Container implements FAMTerminator {
/**
*
*
* @generated
*/
protected FAMTerminatorImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return famPackage.Literals.FAM_TERMINATOR;
}
/**
*
*
* @generated
*/
public FunctionalData getData() {
if (eContainerFeatureID() != famPackage.FAM_TERMINATOR__DATA) return null;
return (FunctionalData)eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetData(FunctionalData newData, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newData, famPackage.FAM_TERMINATOR__DATA, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setData(FunctionalData newData) {
if (newData != eInternalContainer() || (eContainerFeatureID() != famPackage.FAM_TERMINATOR__DATA && newData != null)) {
if (EcoreUtil.isAncestor(this, newData))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newData != null)
msgs = ((InternalEObject)newData).eInverseAdd(this, famPackage.FUNCTIONAL_DATA__TERMINATOR, FunctionalData.class, msgs);
msgs = basicSetData(newData, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, famPackage.FAM_TERMINATOR__DATA, newData, newData));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetData((FunctionalData)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
return basicSetData(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case famPackage.FAM_TERMINATOR__DATA:
return eInternalContainer().eInverseRemove(this, famPackage.FUNCTIONAL_DATA__TERMINATOR, FunctionalData.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
return getData();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
setData((FunctionalData)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
setData((FunctionalData)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case famPackage.FAM_TERMINATOR__DATA:
return getData() != null;
}
return super.eIsSet(featureID);
}
} //FAMTerminatorImpl