/** */ package hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Function; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeReference; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.FunctionAnnotation; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'Function'. * *

* The following features are implemented: *

* * * @generated */ public abstract class FunctionImpl extends SymbolicDeclarationImpl implements Function { /** * The cached value of the '{@link #getRange() Range}' containment reference. * * * @see #getRange() * @generated * @ordered */ protected TypeReference range; /** * The cached value of the '{@link #getParameters() Parameters}' containment reference list. * * * @see #getParameters() * @generated * @ordered */ protected EList parameters; /** * The cached value of the '{@link #getAnnotations() Annotations}' reference list. * * * @see #getAnnotations() * @generated * @ordered */ protected EList annotations; /** * * * @generated */ protected FunctionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return LogiclanguagePackage.Literals.FUNCTION; } /** * * * @generated */ @Override public TypeReference getRange() { return range; } /** * * * @generated */ public NotificationChain basicSetRange(TypeReference newRange, NotificationChain msgs) { TypeReference oldRange = range; range = newRange; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.FUNCTION__RANGE, oldRange, newRange); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setRange(TypeReference newRange) { if (newRange != range) { NotificationChain msgs = null; if (range != null) msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.FUNCTION__RANGE, null, msgs); if (newRange != null) msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.FUNCTION__RANGE, null, msgs); msgs = basicSetRange(newRange, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.FUNCTION__RANGE, newRange, newRange)); } /** * * * @generated */ @Override public EList getParameters() { if (parameters == null) { parameters = new EObjectContainmentEList(TypeReference.class, this, LogiclanguagePackage.FUNCTION__PARAMETERS); } return parameters; } /** * * * @generated */ @Override public EList getAnnotations() { if (annotations == null) { annotations = new EObjectWithInverseResolvingEList(FunctionAnnotation.class, this, LogiclanguagePackage.FUNCTION__ANNOTATIONS, LogicproblemPackage.FUNCTION_ANNOTATION__TARGET); } return annotations; } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LogiclanguagePackage.FUNCTION__ANNOTATIONS: return ((InternalEList)(InternalEList)getAnnotations()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LogiclanguagePackage.FUNCTION__RANGE: return basicSetRange(null, msgs); case LogiclanguagePackage.FUNCTION__PARAMETERS: return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs); case LogiclanguagePackage.FUNCTION__ANNOTATIONS: return ((InternalEList)getAnnotations()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LogiclanguagePackage.FUNCTION__RANGE: return getRange(); case LogiclanguagePackage.FUNCTION__PARAMETERS: return getParameters(); case LogiclanguagePackage.FUNCTION__ANNOTATIONS: return getAnnotations(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LogiclanguagePackage.FUNCTION__RANGE: setRange((TypeReference)newValue); return; case LogiclanguagePackage.FUNCTION__PARAMETERS: getParameters().clear(); getParameters().addAll((Collection)newValue); return; case LogiclanguagePackage.FUNCTION__ANNOTATIONS: getAnnotations().clear(); getAnnotations().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LogiclanguagePackage.FUNCTION__RANGE: setRange((TypeReference)null); return; case LogiclanguagePackage.FUNCTION__PARAMETERS: getParameters().clear(); return; case LogiclanguagePackage.FUNCTION__ANNOTATIONS: getAnnotations().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LogiclanguagePackage.FUNCTION__RANGE: return range != null; case LogiclanguagePackage.FUNCTION__PARAMETERS: return parameters != null && !parameters.isEmpty(); case LogiclanguagePackage.FUNCTION__ANNOTATIONS: return annotations != null && !annotations.isEmpty(); } return super.eIsSet(featureID); } } //FunctionImpl