/** */ package core.impl; import core.CorePackage; import core.IntegerExpression; import core.UnaryExpression; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Unary Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link core.impl.UnaryExpressionImpl#getTarget <em>Target</em>}</li> * </ul> * </p> * * @generated */ public class UnaryExpressionImpl extends IntegerExpressionImpl implements UnaryExpression { /** * The cached value of the '{@link #getTarget() <em>Target</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTarget() * @generated * @ordered */ protected IntegerExpression target; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected UnaryExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CorePackage.Literals.UNARY_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerExpression getTarget() { return target; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetTarget(IntegerExpression newTarget, NotificationChain msgs) { IntegerExpression oldTarget = target; target = newTarget; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CorePackage.UNARY_EXPRESSION__TARGET, oldTarget, newTarget); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTarget(IntegerExpression newTarget) { if (newTarget != target) { NotificationChain msgs = null; if (target != null) msgs = ((InternalEObject)target).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CorePackage.UNARY_EXPRESSION__TARGET, null, msgs); if (newTarget != null) msgs = ((InternalEObject)newTarget).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CorePackage.UNARY_EXPRESSION__TARGET, null, msgs); msgs = basicSetTarget(newTarget, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.UNARY_EXPRESSION__TARGET, newTarget, newTarget)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CorePackage.UNARY_EXPRESSION__TARGET: return basicSetTarget(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CorePackage.UNARY_EXPRESSION__TARGET: return getTarget(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CorePackage.UNARY_EXPRESSION__TARGET: setTarget((IntegerExpression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CorePackage.UNARY_EXPRESSION__TARGET: setTarget((IntegerExpression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CorePackage.UNARY_EXPRESSION__TARGET: return target != null; } return super.eIsSet(featureID); } } //UnaryExpressionImpl