/**
*/
package functionalarchitecture.impl;
import functionalarchitecture.FAMTerminator;
import functionalarchitecture.FunctionalData;
import functionalarchitecture.FunctionalarchitecturePackage;
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 functionalarchitecture.impl.FunctionalDataImpl#getTerminator Terminator}
* - {@link functionalarchitecture.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 FunctionalarchitecturePackage.Literals.FUNCTIONAL_DATA;
}
/**
*
*
* @generated
*/
@Override
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, FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR, oldTerminator, newTerminator);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setTerminator(FAMTerminator newTerminator) {
if (newTerminator != terminator) {
NotificationChain msgs = null;
if (terminator != null)
msgs = ((InternalEObject)terminator).eInverseRemove(this, FunctionalarchitecturePackage.FAM_TERMINATOR__DATA, FAMTerminator.class, msgs);
if (newTerminator != null)
msgs = ((InternalEObject)newTerminator).eInverseAdd(this, FunctionalarchitecturePackage.FAM_TERMINATOR__DATA, FAMTerminator.class, msgs);
msgs = basicSetTerminator(newTerminator, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR, newTerminator, newTerminator));
}
/**
*
*
* @generated
*/
@Override
public functionalarchitecture.FunctionalInterface getInterface() {
if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE) return null;
return (functionalarchitecture.FunctionalInterface)eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetInterface(functionalarchitecture.FunctionalInterface newInterface, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newInterface, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE, msgs);
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setInterface(functionalarchitecture.FunctionalInterface newInterface) {
if (newInterface != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.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, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, functionalarchitecture.FunctionalInterface.class, msgs);
msgs = basicSetInterface(newInterface, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE, newInterface, newInterface));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
if (terminator != null)
msgs = ((InternalEObject)terminator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR, null, msgs);
return basicSetTerminator((FAMTerminator)otherEnd, msgs);
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetInterface((functionalarchitecture.FunctionalInterface)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
return basicSetTerminator(null, msgs);
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
return basicSetInterface(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
return eInternalContainer().eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, functionalarchitecture.FunctionalInterface.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
return getTerminator();
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
return getInterface();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
setTerminator((FAMTerminator)newValue);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
setInterface((functionalarchitecture.FunctionalInterface)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
setTerminator((FAMTerminator)null);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
setInterface((functionalarchitecture.FunctionalInterface)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__TERMINATOR:
return terminator != null;
case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE:
return getInterface() != null;
}
return super.eIsSet(featureID);
}
} //FunctionalDataImpl