/**
*/
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.FunctionalInterface;
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 'Functional Data'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalDataImpl#getTerminator Terminator}
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalDataImpl#getInterface Interface}
*
*
* @generated
*/
public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container implements FunctionalData {
/**
* The cached value of the '{@link #getTerminator() Terminator}' containment reference.
*
*
* @see #getTerminator()
* @generated
* @ordered
*/
protected FAMTerminator terminator;
/**
*
*
* @generated
*/
protected FunctionalDataImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return famPackage.Literals.FUNCTIONAL_DATA;
}
/**
*
*
* @generated
*/
public FAMTerminator getTerminator() {
return terminator;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTerminator(FAMTerminator newTerminator, NotificationChain msgs) {
FAMTerminator oldTerminator = terminator;
terminator = newTerminator;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, famPackage.FUNCTIONAL_DATA__TERMINATOR, oldTerminator, newTerminator);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTerminator(FAMTerminator newTerminator) {
if (newTerminator != terminator) {
NotificationChain msgs = null;
if (terminator != null)
msgs = ((InternalEObject)terminator).eInverseRemove(this, famPackage.FAM_TERMINATOR__DATA, FAMTerminator.class, msgs);
if (newTerminator != null)
msgs = ((InternalEObject)newTerminator).eInverseAdd(this, famPackage.FAM_TERMINATOR__DATA, FAMTerminator.class, msgs);
msgs = basicSetTerminator(newTerminator, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, famPackage.FUNCTIONAL_DATA__TERMINATOR, newTerminator, newTerminator));
}
/**
*
*
* @generated
*/
public FunctionalInterface getInterface() {
if (eContainerFeatureID() != famPackage.FUNCTIONAL_DATA__INTERFACE) return null;
return (FunctionalInterface)eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetInterface(FunctionalInterface newInterface, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newInterface, famPackage.FUNCTIONAL_DATA__INTERFACE, msgs);
return msgs;
}
/**
*
*
* @generated
*/
public void setInterface(FunctionalInterface newInterface) {
if (newInterface != eInternalContainer() || (eContainerFeatureID() != famPackage.FUNCTIONAL_DATA__INTERFACE && newInterface != null)) {
if (EcoreUtil.isAncestor(this, newInterface))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newInterface != null)
msgs = ((InternalEObject)newInterface).eInverseAdd(this, famPackage.FUNCTIONAL_INTERFACE__DATA, FunctionalInterface.class, msgs);
msgs = basicSetInterface(newInterface, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, famPackage.FUNCTIONAL_DATA__INTERFACE, newInterface, newInterface));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
if (terminator != null)
msgs = ((InternalEObject)terminator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - famPackage.FUNCTIONAL_DATA__TERMINATOR, null, msgs);
return basicSetTerminator((FAMTerminator)otherEnd, msgs);
case famPackage.FUNCTIONAL_DATA__INTERFACE:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetInterface((FunctionalInterface)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
return basicSetTerminator(null, msgs);
case famPackage.FUNCTIONAL_DATA__INTERFACE:
return basicSetInterface(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case famPackage.FUNCTIONAL_DATA__INTERFACE:
return eInternalContainer().eInverseRemove(this, famPackage.FUNCTIONAL_INTERFACE__DATA, FunctionalInterface.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
return getTerminator();
case famPackage.FUNCTIONAL_DATA__INTERFACE:
return getInterface();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
setTerminator((FAMTerminator)newValue);
return;
case famPackage.FUNCTIONAL_DATA__INTERFACE:
setInterface((FunctionalInterface)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
setTerminator((FAMTerminator)null);
return;
case famPackage.FUNCTIONAL_DATA__INTERFACE:
setInterface((FunctionalInterface)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case famPackage.FUNCTIONAL_DATA__TERMINATOR:
return terminator != null;
case famPackage.FUNCTIONAL_DATA__INTERFACE:
return getInterface() != null;
}
return super.eIsSet(featureID);
}
} //FunctionalDataImpl