/** */ package de.ugoe.cs.swe.bnftools.ebnf.impl; import de.ugoe.cs.swe.bnftools.ebnf.Atom; import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage; import de.ugoe.cs.swe.bnftools.ebnf.RuleReference; import de.ugoe.cs.swe.bnftools.ebnf.StringRule; 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 'Atom'. * *

* The following features are implemented: *

*

* * @generated */ public class AtomImpl extends MinimalEObjectImpl.Container implements Atom { /** * The cached value of the '{@link #getAtomStringRule() Atom String Rule}' containment reference. * * * @see #getAtomStringRule() * @generated * @ordered */ protected StringRule atomStringRule; /** * The cached value of the '{@link #getAtomRuleReference() Atom Rule Reference}' containment reference. * * * @see #getAtomRuleReference() * @generated * @ordered */ protected RuleReference atomRuleReference; /** * * * @generated */ protected AtomImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return EbnfPackage.Literals.ATOM; } /** * * * @generated */ public StringRule getAtomStringRule() { return atomStringRule; } /** * * * @generated */ public NotificationChain basicSetAtomStringRule(StringRule newAtomStringRule, NotificationChain msgs) { StringRule oldAtomStringRule = atomStringRule; atomStringRule = newAtomStringRule; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_STRING_RULE, oldAtomStringRule, newAtomStringRule); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setAtomStringRule(StringRule newAtomStringRule) { if (newAtomStringRule != atomStringRule) { NotificationChain msgs = null; if (atomStringRule != null) msgs = ((InternalEObject)atomStringRule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_STRING_RULE, null, msgs); if (newAtomStringRule != null) msgs = ((InternalEObject)newAtomStringRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_STRING_RULE, null, msgs); msgs = basicSetAtomStringRule(newAtomStringRule, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_STRING_RULE, newAtomStringRule, newAtomStringRule)); } /** * * * @generated */ public RuleReference getAtomRuleReference() { return atomRuleReference; } /** * * * @generated */ public NotificationChain basicSetAtomRuleReference(RuleReference newAtomRuleReference, NotificationChain msgs) { RuleReference oldAtomRuleReference = atomRuleReference; atomRuleReference = newAtomRuleReference; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_RULE_REFERENCE, oldAtomRuleReference, newAtomRuleReference); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setAtomRuleReference(RuleReference newAtomRuleReference) { if (newAtomRuleReference != atomRuleReference) { NotificationChain msgs = null; if (atomRuleReference != null) msgs = ((InternalEObject)atomRuleReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_RULE_REFERENCE, null, msgs); if (newAtomRuleReference != null) msgs = ((InternalEObject)newAtomRuleReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.ATOM__ATOM_RULE_REFERENCE, null, msgs); msgs = basicSetAtomRuleReference(newAtomRuleReference, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.ATOM__ATOM_RULE_REFERENCE, newAtomRuleReference, newAtomRuleReference)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case EbnfPackage.ATOM__ATOM_STRING_RULE: return basicSetAtomStringRule(null, msgs); case EbnfPackage.ATOM__ATOM_RULE_REFERENCE: return basicSetAtomRuleReference(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case EbnfPackage.ATOM__ATOM_STRING_RULE: return getAtomStringRule(); case EbnfPackage.ATOM__ATOM_RULE_REFERENCE: return getAtomRuleReference(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EbnfPackage.ATOM__ATOM_STRING_RULE: setAtomStringRule((StringRule)newValue); return; case EbnfPackage.ATOM__ATOM_RULE_REFERENCE: setAtomRuleReference((RuleReference)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EbnfPackage.ATOM__ATOM_STRING_RULE: setAtomStringRule((StringRule)null); return; case EbnfPackage.ATOM__ATOM_RULE_REFERENCE: setAtomRuleReference((RuleReference)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EbnfPackage.ATOM__ATOM_STRING_RULE: return atomStringRule != null; case EbnfPackage.ATOM__ATOM_RULE_REFERENCE: return atomRuleReference != null; } return super.eIsSet(featureID); } } //AtomImpl