/** * generated by Xtext 2.16.0 */ package hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.impl; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.Assignment; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.CftLanguagePackage; import hu.bme.mit.inf.dslreasoner.faulttree.components.cftLanguage.EventReference; 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; /** * * An implementation of the model object 'Assignment'. * *

* The following features are implemented: *

* * * @generated */ public class AssignmentImpl extends MinimalEObjectImpl.Container implements Assignment { /** * The cached value of the '{@link #getInput() Input}' containment reference. * * * @see #getInput() * @generated * @ordered */ protected EventReference input; /** * The default value of the '{@link #isMultiple() Multiple}' attribute. * * * @see #isMultiple() * @generated * @ordered */ protected static final boolean MULTIPLE_EDEFAULT = false; /** * The cached value of the '{@link #isMultiple() Multiple}' attribute. * * * @see #isMultiple() * @generated * @ordered */ protected boolean multiple = MULTIPLE_EDEFAULT; /** * The cached value of the '{@link #getOutput() Output}' containment reference. * * * @see #getOutput() * @generated * @ordered */ protected EventReference output; /** * * * @generated */ protected AssignmentImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return CftLanguagePackage.Literals.ASSIGNMENT; } /** * * * @generated */ @Override public EventReference getInput() { return input; } /** * * * @generated */ public NotificationChain basicSetInput(EventReference newInput, NotificationChain msgs) { EventReference oldInput = input; input = newInput; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CftLanguagePackage.ASSIGNMENT__INPUT, oldInput, newInput); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setInput(EventReference newInput) { if (newInput != input) { NotificationChain msgs = null; if (input != null) msgs = ((InternalEObject)input).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CftLanguagePackage.ASSIGNMENT__INPUT, null, msgs); if (newInput != null) msgs = ((InternalEObject)newInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CftLanguagePackage.ASSIGNMENT__INPUT, null, msgs); msgs = basicSetInput(newInput, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.ASSIGNMENT__INPUT, newInput, newInput)); } /** * * * @generated */ @Override public boolean isMultiple() { return multiple; } /** * * * @generated */ @Override public void setMultiple(boolean newMultiple) { boolean oldMultiple = multiple; multiple = newMultiple; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.ASSIGNMENT__MULTIPLE, oldMultiple, multiple)); } /** * * * @generated */ @Override public EventReference getOutput() { return output; } /** * * * @generated */ public NotificationChain basicSetOutput(EventReference newOutput, NotificationChain msgs) { EventReference oldOutput = output; output = newOutput; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CftLanguagePackage.ASSIGNMENT__OUTPUT, oldOutput, newOutput); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setOutput(EventReference newOutput) { if (newOutput != output) { NotificationChain msgs = null; if (output != null) msgs = ((InternalEObject)output).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CftLanguagePackage.ASSIGNMENT__OUTPUT, null, msgs); if (newOutput != null) msgs = ((InternalEObject)newOutput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CftLanguagePackage.ASSIGNMENT__OUTPUT, null, msgs); msgs = basicSetOutput(newOutput, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CftLanguagePackage.ASSIGNMENT__OUTPUT, newOutput, newOutput)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CftLanguagePackage.ASSIGNMENT__INPUT: return basicSetInput(null, msgs); case CftLanguagePackage.ASSIGNMENT__OUTPUT: return basicSetOutput(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CftLanguagePackage.ASSIGNMENT__INPUT: return getInput(); case CftLanguagePackage.ASSIGNMENT__MULTIPLE: return isMultiple(); case CftLanguagePackage.ASSIGNMENT__OUTPUT: return getOutput(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CftLanguagePackage.ASSIGNMENT__INPUT: setInput((EventReference)newValue); return; case CftLanguagePackage.ASSIGNMENT__MULTIPLE: setMultiple((Boolean)newValue); return; case CftLanguagePackage.ASSIGNMENT__OUTPUT: setOutput((EventReference)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CftLanguagePackage.ASSIGNMENT__INPUT: setInput((EventReference)null); return; case CftLanguagePackage.ASSIGNMENT__MULTIPLE: setMultiple(MULTIPLE_EDEFAULT); return; case CftLanguagePackage.ASSIGNMENT__OUTPUT: setOutput((EventReference)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CftLanguagePackage.ASSIGNMENT__INPUT: return input != null; case CftLanguagePackage.ASSIGNMENT__MULTIPLE: return multiple != MULTIPLE_EDEFAULT; case CftLanguagePackage.ASSIGNMENT__OUTPUT: return output != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (multiple: "); result.append(multiple); result.append(')'); return result.toString(); } } //AssignmentImpl