/** */ package hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.impl; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Constant; import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.LogiclanguagePackage; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.ConstantAnnotation; import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicproblemPackage; 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 Annotation'. * *

* The following features are implemented: *

* * * @generated */ public class ConstantAnnotationImpl extends AnnotationImpl implements ConstantAnnotation { /** * The cached value of the '{@link #getTarget() Target}' reference. * * * @see #getTarget() * @generated * @ordered */ protected Constant target; /** * * * @generated */ protected ConstantAnnotationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return LogicproblemPackage.Literals.CONSTANT_ANNOTATION; } /** * * * @generated */ public Constant getTarget() { if (target != null && target.eIsProxy()) { InternalEObject oldTarget = (InternalEObject)target; target = (Constant)eResolveProxy(oldTarget); if (target != oldTarget) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, LogicproblemPackage.CONSTANT_ANNOTATION__TARGET, oldTarget, target)); } } return target; } /** * * * @generated */ public Constant basicGetTarget() { return target; } /** * * * @generated */ public NotificationChain basicSetTarget(Constant newTarget, NotificationChain msgs) { Constant oldTarget = target; target = newTarget; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LogicproblemPackage.CONSTANT_ANNOTATION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setTarget(Constant newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, LogiclanguagePackage.CONSTANT__ANNOTATIONS, Constant.class, msgs); if (newTarget != null) msgs = ((InternalEObject)newTarget).eInverseAdd(this, LogiclanguagePackage.CONSTANT__ANNOTATIONS, Constant.class, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LogicproblemPackage.CONSTANT_ANNOTATION__TARGET, newTarget, newTarget)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LogicproblemPackage.CONSTANT_ANNOTATION__TARGET: if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, LogiclanguagePackage.CONSTANT__ANNOTATIONS, Constant.class, msgs); return basicSetTarget((Constant)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LogicproblemPackage.CONSTANT_ANNOTATION__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 LogicproblemPackage.CONSTANT_ANNOTATION__TARGET: if (resolve) return getTarget(); return basicGetTarget(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LogicproblemPackage.CONSTANT_ANNOTATION__TARGET: setTarget((Constant)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LogicproblemPackage.CONSTANT_ANNOTATION__TARGET: setTarget((Constant)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LogicproblemPackage.CONSTANT_ANNOTATION__TARGET: return target != null; } return super.eIsSet(featureID); } } //ConstantAnnotationImpl