/** * generated by Xtext 2.21.0 */ package org.eclipse.viatra.solver.language.solverLanguage.impl; 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.viatra.solver.language.solverLanguage.Expression; import org.eclipse.viatra.solver.language.solverLanguage.Interpretation; import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; /** * * An implementation of the model object 'Interpretation'. * *

* The following features are implemented: *

* * * @generated */ public class InterpretationImpl extends StatementImpl implements Interpretation { /** * The cached value of the '{@link #getBody() Body}' containment reference. * * * @see #getBody() * @generated * @ordered */ protected Expression body; /** * The cached value of the '{@link #getRange() Range}' containment reference. * * * @see #getRange() * @generated * @ordered */ protected Expression range; /** * * * @generated */ protected InterpretationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SolverLanguagePackage.Literals.INTERPRETATION; } /** * * * @generated */ @Override public Expression getBody() { return body; } /** * * * @generated */ public NotificationChain basicSetBody(Expression newBody, NotificationChain msgs) { Expression oldBody = body; body = newBody; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERPRETATION__BODY, oldBody, newBody); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setBody(Expression newBody) { if (newBody != body) { NotificationChain msgs = null; if (body != null) msgs = ((InternalEObject)body).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERPRETATION__BODY, null, msgs); if (newBody != null) msgs = ((InternalEObject)newBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERPRETATION__BODY, null, msgs); msgs = basicSetBody(newBody, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERPRETATION__BODY, newBody, newBody)); } /** * * * @generated */ @Override public Expression getRange() { return range; } /** * * * @generated */ public NotificationChain basicSetRange(Expression newRange, NotificationChain msgs) { Expression oldRange = range; range = newRange; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERPRETATION__RANGE, oldRange, newRange); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setRange(Expression newRange) { if (newRange != range) { NotificationChain msgs = null; if (range != null) msgs = ((InternalEObject)range).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERPRETATION__RANGE, null, msgs); if (newRange != null) msgs = ((InternalEObject)newRange).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.INTERPRETATION__RANGE, null, msgs); msgs = basicSetRange(newRange, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.INTERPRETATION__RANGE, newRange, newRange)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SolverLanguagePackage.INTERPRETATION__BODY: return basicSetBody(null, msgs); case SolverLanguagePackage.INTERPRETATION__RANGE: return basicSetRange(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SolverLanguagePackage.INTERPRETATION__BODY: return getBody(); case SolverLanguagePackage.INTERPRETATION__RANGE: return getRange(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SolverLanguagePackage.INTERPRETATION__BODY: setBody((Expression)newValue); return; case SolverLanguagePackage.INTERPRETATION__RANGE: setRange((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SolverLanguagePackage.INTERPRETATION__BODY: setBody((Expression)null); return; case SolverLanguagePackage.INTERPRETATION__RANGE: setRange((Expression)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SolverLanguagePackage.INTERPRETATION__BODY: return body != null; case SolverLanguagePackage.INTERPRETATION__RANGE: return range != null; } return super.eIsSet(featureID); } } //InterpretationImpl