/** * generated by Xtext 2.18.0.M3 */ 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.GlobalRelationInterpretation; import org.eclipse.viatra.solver.language.solverLanguage.ModelSymbol; import org.eclipse.viatra.solver.language.solverLanguage.MultiplicityDefinition; import org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage; import org.eclipse.viatra.solver.language.solverLanguage.Symbol; /** * * An implementation of the model object 'Global Relation Interpretation'. * *

* The following features are implemented: *

* * * @generated */ public class GlobalRelationInterpretationImpl extends CDInterpretationImpl implements GlobalRelationInterpretation { /** * The default value of the '{@link #isContainment() Containment}' attribute. * * * @see #isContainment() * @generated * @ordered */ protected static final boolean CONTAINMENT_EDEFAULT = false; /** * The cached value of the '{@link #isContainment() Containment}' attribute. * * * @see #isContainment() * @generated * @ordered */ protected boolean containment = CONTAINMENT_EDEFAULT; /** * The cached value of the '{@link #getSymbol() Symbol}' containment reference. * * * @see #getSymbol() * @generated * @ordered */ protected ModelSymbol symbol; /** * The cached value of the '{@link #getSourceMultiplicity() Source Multiplicity}' containment reference. * * * @see #getSourceMultiplicity() * @generated * @ordered */ protected MultiplicityDefinition sourceMultiplicity; /** * The cached value of the '{@link #getSource() Source}' containment reference. * * * @see #getSource() * @generated * @ordered */ protected Symbol source; /** * The cached value of the '{@link #getTargetMultiplicity() Target Multiplicity}' containment reference. * * * @see #getTargetMultiplicity() * @generated * @ordered */ protected MultiplicityDefinition targetMultiplicity; /** * The cached value of the '{@link #getTarget() Target}' containment reference. * * * @see #getTarget() * @generated * @ordered */ protected Symbol target; /** * * * @generated */ protected GlobalRelationInterpretationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return SolverLanguagePackage.Literals.GLOBAL_RELATION_INTERPRETATION; } /** * * * @generated */ @Override public boolean isContainment() { return containment; } /** * * * @generated */ @Override public void setContainment(boolean newContainment) { boolean oldContainment = containment; containment = newContainment; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__CONTAINMENT, oldContainment, containment)); } /** * * * @generated */ @Override public ModelSymbol getSymbol() { return symbol; } /** * * * @generated */ public NotificationChain basicSetSymbol(ModelSymbol newSymbol, NotificationChain msgs) { ModelSymbol oldSymbol = symbol; symbol = newSymbol; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL, oldSymbol, newSymbol); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setSymbol(ModelSymbol newSymbol) { if (newSymbol != symbol) { NotificationChain msgs = null; if (symbol != null) msgs = ((InternalEObject)symbol).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL, null, msgs); if (newSymbol != null) msgs = ((InternalEObject)newSymbol).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL, null, msgs); msgs = basicSetSymbol(newSymbol, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL, newSymbol, newSymbol)); } /** * * * @generated */ @Override public MultiplicityDefinition getSourceMultiplicity() { return sourceMultiplicity; } /** * * * @generated */ public NotificationChain basicSetSourceMultiplicity(MultiplicityDefinition newSourceMultiplicity, NotificationChain msgs) { MultiplicityDefinition oldSourceMultiplicity = sourceMultiplicity; sourceMultiplicity = newSourceMultiplicity; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY, oldSourceMultiplicity, newSourceMultiplicity); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setSourceMultiplicity(MultiplicityDefinition newSourceMultiplicity) { if (newSourceMultiplicity != sourceMultiplicity) { NotificationChain msgs = null; if (sourceMultiplicity != null) msgs = ((InternalEObject)sourceMultiplicity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY, null, msgs); if (newSourceMultiplicity != null) msgs = ((InternalEObject)newSourceMultiplicity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY, null, msgs); msgs = basicSetSourceMultiplicity(newSourceMultiplicity, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY, newSourceMultiplicity, newSourceMultiplicity)); } /** * * * @generated */ @Override public Symbol getSource() { return source; } /** * * * @generated */ public NotificationChain basicSetSource(Symbol newSource, NotificationChain msgs) { Symbol oldSource = source; source = newSource; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE, oldSource, newSource); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setSource(Symbol newSource) { if (newSource != source) { NotificationChain msgs = null; if (source != null) msgs = ((InternalEObject)source).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE, null, msgs); if (newSource != null) msgs = ((InternalEObject)newSource).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE, null, msgs); msgs = basicSetSource(newSource, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE, newSource, newSource)); } /** * * * @generated */ @Override public MultiplicityDefinition getTargetMultiplicity() { return targetMultiplicity; } /** * * * @generated */ public NotificationChain basicSetTargetMultiplicity(MultiplicityDefinition newTargetMultiplicity, NotificationChain msgs) { MultiplicityDefinition oldTargetMultiplicity = targetMultiplicity; targetMultiplicity = newTargetMultiplicity; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY, oldTargetMultiplicity, newTargetMultiplicity); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setTargetMultiplicity(MultiplicityDefinition newTargetMultiplicity) { if (newTargetMultiplicity != targetMultiplicity) { NotificationChain msgs = null; if (targetMultiplicity != null) msgs = ((InternalEObject)targetMultiplicity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY, null, msgs); if (newTargetMultiplicity != null) msgs = ((InternalEObject)newTargetMultiplicity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY, null, msgs); msgs = basicSetTargetMultiplicity(newTargetMultiplicity, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY, newTargetMultiplicity, newTargetMultiplicity)); } /** * * * @generated */ @Override public Symbol getTarget() { return target; } /** * * * @generated */ public NotificationChain basicSetTarget(Symbol newTarget, NotificationChain msgs) { Symbol oldTarget = target; target = newTarget; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setTarget(Symbol newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET, null, msgs); if (newTarget != null) msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET, null, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET, newTarget, newTarget)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL: return basicSetSymbol(null, msgs); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY: return basicSetSourceMultiplicity(null, msgs); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE: return basicSetSource(null, msgs); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY: return basicSetTargetMultiplicity(null, msgs); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET: return basicSetTarget(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__CONTAINMENT: return isContainment(); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL: return getSymbol(); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY: return getSourceMultiplicity(); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE: return getSource(); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY: return getTargetMultiplicity(); case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET: return getTarget(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__CONTAINMENT: setContainment((Boolean)newValue); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL: setSymbol((ModelSymbol)newValue); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY: setSourceMultiplicity((MultiplicityDefinition)newValue); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE: setSource((Symbol)newValue); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY: setTargetMultiplicity((MultiplicityDefinition)newValue); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET: setTarget((Symbol)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__CONTAINMENT: setContainment(CONTAINMENT_EDEFAULT); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL: setSymbol((ModelSymbol)null); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY: setSourceMultiplicity((MultiplicityDefinition)null); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE: setSource((Symbol)null); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY: setTargetMultiplicity((MultiplicityDefinition)null); return; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET: setTarget((Symbol)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__CONTAINMENT: return containment != CONTAINMENT_EDEFAULT; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SYMBOL: return symbol != null; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE_MULTIPLICITY: return sourceMultiplicity != null; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__SOURCE: return source != null; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET_MULTIPLICITY: return targetMultiplicity != null; case SolverLanguagePackage.GLOBAL_RELATION_INTERPRETATION__TARGET: return target != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (containment: "); result.append(containment); result.append(')'); return result.toString(); } } //GlobalRelationInterpretationImpl