/**
*/
package functionalarchitecture.impl;
import functionalarchitecture.Function;
import functionalarchitecture.FunctionalArchitectureModel;
import functionalarchitecture.FunctionalElement;
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 Element'.
*
*
* The following features are implemented:
*
*
* - {@link functionalarchitecture.impl.FunctionalElementImpl#getInterface Interface}
* - {@link functionalarchitecture.impl.FunctionalElementImpl#getModel Model}
* - {@link functionalarchitecture.impl.FunctionalElementImpl#getParent Parent}
*
*
* @generated
*/
public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container implements FunctionalElement {
/**
* The cached value of the '{@link #getInterface() Interface}' containment reference.
*
*
* @see #getInterface()
* @generated
* @ordered
*/
protected functionalarchitecture.FunctionalInterface interface_;
/**
*
*
* @generated
*/
protected FunctionalElementImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return FunctionalarchitecturePackage.Literals.FUNCTIONAL_ELEMENT;
}
/**
*
*
* @generated
*/
@Override
public functionalarchitecture.FunctionalInterface getInterface() {
return interface_;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetInterface(functionalarchitecture.FunctionalInterface newInterface, NotificationChain msgs) {
functionalarchitecture.FunctionalInterface oldInterface = interface_;
interface_ = newInterface;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, oldInterface, newInterface);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setInterface(functionalarchitecture.FunctionalInterface newInterface) {
if (newInterface != interface_) {
NotificationChain msgs = null;
if (interface_ != null)
msgs = ((InternalEObject)interface_).eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, functionalarchitecture.FunctionalInterface.class, msgs);
if (newInterface != null)
msgs = ((InternalEObject)newInterface).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, functionalarchitecture.FunctionalInterface.class, msgs);
msgs = basicSetInterface(newInterface, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, newInterface, newInterface));
}
/**
*
*
* @generated
*/
@Override
public FunctionalArchitectureModel getModel() {
FunctionalArchitectureModel model = basicGetModel();
return model != null && model.eIsProxy() ? (FunctionalArchitectureModel)eResolveProxy((InternalEObject)model) : model;
}
/**
*
*
* @generated
*/
public FunctionalArchitectureModel basicGetModel() {
// TODO: implement this method to return the 'Model' reference
// -> do not perform proxy resolution
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
*
*
* @generated
*/
@Override
public void setModel(FunctionalArchitectureModel newModel) {
// TODO: implement this method to set the 'Model' reference
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
*
*
* @generated
*/
@Override
public Function getParent() {
if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT) return null;
return (Function)eInternalContainer();
}
/**
*
*
* @generated
*/
public NotificationChain basicSetParent(Function newParent, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newParent, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT, msgs);
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setParent(Function newParent) {
if (newParent != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT && newParent != null)) {
if (EcoreUtil.isAncestor(this, newParent))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParent != null)
msgs = ((InternalEObject)newParent).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS, Function.class, msgs);
msgs = basicSetParent(newParent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT, newParent, newParent));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
if (interface_ != null)
msgs = ((InternalEObject)interface_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, null, msgs);
return basicSetInterface((functionalarchitecture.FunctionalInterface)otherEnd, msgs);
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetParent((Function)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
return basicSetInterface(null, msgs);
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
return basicSetParent(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
return eInternalContainer().eInverseRemove(this, FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS, Function.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
return getInterface();
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL:
if (resolve) return getModel();
return basicGetModel();
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
return getParent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
setInterface((functionalarchitecture.FunctionalInterface)newValue);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL:
setModel((FunctionalArchitectureModel)newValue);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
setParent((Function)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
setInterface((functionalarchitecture.FunctionalInterface)null);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL:
setModel((FunctionalArchitectureModel)null);
return;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
setParent((Function)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE:
return interface_ != null;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL:
return basicGetModel() != null;
case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT:
return getParent() != null;
}
return super.eIsSet(featureID);
}
} //FunctionalElementImpl