/**
* <copyright>
* </copyright>
*
* $Id$
*/
package net.sf.etl.samples.ej.ast.impl;
import net.sf.etl.samples.ej.ast.AstPackage;
import net.sf.etl.samples.ej.ast.Expression;
import net.sf.etl.samples.ej.ast.MinusOp;
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>Minus Op</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link net.sf.etl.samples.ej.ast.impl.MinusOpImpl#getMinuend <em>Minuend</em>}</li>
* <li>{@link net.sf.etl.samples.ej.ast.impl.MinusOpImpl#getSubtrahend <em>Subtrahend</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MinusOpImpl extends ExpressionImpl implements MinusOp {
/**
* The cached value of the '{@link #getMinuend() <em>Minuend</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMinuend()
* @generated
* @ordered
*/
protected Expression minuend = null;
/**
* The cached value of the '{@link #getSubtrahend() <em>Subtrahend</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSubtrahend()
* @generated
* @ordered
*/
protected Expression subtrahend = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MinusOpImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return AstPackage.Literals.MINUS_OP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getMinuend() {
return minuend;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMinuend(Expression newMinuend, NotificationChain msgs) {
Expression oldMinuend = minuend;
minuend = newMinuend;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.MINUS_OP__MINUEND, oldMinuend, newMinuend);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMinuend(Expression newMinuend) {
if (newMinuend != minuend) {
NotificationChain msgs = null;
if (minuend != null)
msgs = ((InternalEObject)minuend).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.MINUS_OP__MINUEND, null, msgs);
if (newMinuend != null)
msgs = ((InternalEObject)newMinuend).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.MINUS_OP__MINUEND, null, msgs);
msgs = basicSetMinuend(newMinuend, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.MINUS_OP__MINUEND, newMinuend, newMinuend));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getSubtrahend() {
return subtrahend;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSubtrahend(Expression newSubtrahend, NotificationChain msgs) {
Expression oldSubtrahend = subtrahend;
subtrahend = newSubtrahend;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.MINUS_OP__SUBTRAHEND, oldSubtrahend, newSubtrahend);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSubtrahend(Expression newSubtrahend) {
if (newSubtrahend != subtrahend) {
NotificationChain msgs = null;
if (subtrahend != null)
msgs = ((InternalEObject)subtrahend).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.MINUS_OP__SUBTRAHEND, null, msgs);
if (newSubtrahend != null)
msgs = ((InternalEObject)newSubtrahend).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.MINUS_OP__SUBTRAHEND, null, msgs);
msgs = basicSetSubtrahend(newSubtrahend, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.MINUS_OP__SUBTRAHEND, newSubtrahend, newSubtrahend));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AstPackage.MINUS_OP__MINUEND:
return basicSetMinuend(null, msgs);
case AstPackage.MINUS_OP__SUBTRAHEND:
return basicSetSubtrahend(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AstPackage.MINUS_OP__MINUEND:
return getMinuend();
case AstPackage.MINUS_OP__SUBTRAHEND:
return getSubtrahend();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AstPackage.MINUS_OP__MINUEND:
setMinuend((Expression)newValue);
return;
case AstPackage.MINUS_OP__SUBTRAHEND:
setSubtrahend((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case AstPackage.MINUS_OP__MINUEND:
setMinuend((Expression)null);
return;
case AstPackage.MINUS_OP__SUBTRAHEND:
setSubtrahend((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case AstPackage.MINUS_OP__MINUEND:
return minuend != null;
case AstPackage.MINUS_OP__SUBTRAHEND:
return subtrahend != null;
}
return super.eIsSet(featureID);
}
} //MinusOpImpl