/** */ package hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.impl; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDeclaration; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDefinition; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term; 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; /** * * An implementation of the model object 'Constant Definition'. * *

* The following features are implemented: *

* * * @generated */ public class ConstantDefinitionImpl extends ConstantImpl implements ConstantDefinition { /** * The cached value of the '{@link #getValue() Value}' containment reference. * * * @see #getValue() * @generated * @ordered */ protected Term value; /** * The cached value of the '{@link #getDefines() Defines}' reference. * * * @see #getDefines() * @generated * @ordered */ protected ConstantDeclaration defines; /** * * * @generated */ protected ConstantDefinitionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return LogiclanguagePackage.Literals.CONSTANT_DEFINITION; } /** * * * @generated */ @Override public Term getValue() { return value; } /** * * * @generated */ public NotificationChain basicSetValue(Term newValue, NotificationChain msgs) { Term oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.CONSTANT_DEFINITION__VALUE, oldValue, newValue); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ @Override public void setValue(Term newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.CONSTANT_DEFINITION__VALUE, null, msgs); if (newValue != null) msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LogiclanguagePackage.CONSTANT_DEFINITION__VALUE, null, msgs); msgs = basicSetValue(newValue, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.CONSTANT_DEFINITION__VALUE, newValue, newValue)); } /** * * * @generated */ @Override public ConstantDeclaration getDefines() { if (defines != null && defines.eIsProxy()) { InternalEObject oldDefines = (InternalEObject)defines; defines = (ConstantDeclaration)eResolveProxy(oldDefines); if (defines != oldDefines) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES, oldDefines, defines)); } } return defines; } /** * * * @generated */ public ConstantDeclaration basicGetDefines() { return defines; } /** * * * @generated */ @Override public void setDefines(ConstantDeclaration newDefines) { ConstantDeclaration oldDefines = defines; defines = newDefines; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES, oldDefines, defines)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LogiclanguagePackage.CONSTANT_DEFINITION__VALUE: return basicSetValue(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LogiclanguagePackage.CONSTANT_DEFINITION__VALUE: return getValue(); case LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES: if (resolve) return getDefines(); return basicGetDefines(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LogiclanguagePackage.CONSTANT_DEFINITION__VALUE: setValue((Term)newValue); return; case LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES: setDefines((ConstantDeclaration)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LogiclanguagePackage.CONSTANT_DEFINITION__VALUE: setValue((Term)null); return; case LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES: setDefines((ConstantDeclaration)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LogiclanguagePackage.CONSTANT_DEFINITION__VALUE: return value != null; case LogiclanguagePackage.CONSTANT_DEFINITION__DEFINES: return defines != null; } return super.eIsSet(featureID); } } //ConstantDefinitionImpl