/** * <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.DivisionOp; import net.sf.etl.samples.ej.ast.Expression; 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>Division Op</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.sf.etl.samples.ej.ast.impl.DivisionOpImpl#getDividend <em>Dividend</em>}</li> * <li>{@link net.sf.etl.samples.ej.ast.impl.DivisionOpImpl#getDivisor <em>Divisor</em>}</li> * </ul> * </p> * * @generated */ public abstract class DivisionOpImpl extends ExpressionImpl implements DivisionOp { /** * The cached value of the '{@link #getDividend() <em>Dividend</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDividend() * @generated * @ordered */ protected Expression dividend = null; /** * The cached value of the '{@link #getDivisor() <em>Divisor</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDivisor() * @generated * @ordered */ protected Expression divisor = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DivisionOpImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return AstPackage.Literals.DIVISION_OP; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getDividend() { return dividend; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDividend(Expression newDividend, NotificationChain msgs) { Expression oldDividend = dividend; dividend = newDividend; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.DIVISION_OP__DIVIDEND, oldDividend, newDividend); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDividend(Expression newDividend) { if (newDividend != dividend) { NotificationChain msgs = null; if (dividend != null) msgs = ((InternalEObject)dividend).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.DIVISION_OP__DIVIDEND, null, msgs); if (newDividend != null) msgs = ((InternalEObject)newDividend).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.DIVISION_OP__DIVIDEND, null, msgs); msgs = basicSetDividend(newDividend, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.DIVISION_OP__DIVIDEND, newDividend, newDividend)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getDivisor() { return divisor; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDivisor(Expression newDivisor, NotificationChain msgs) { Expression oldDivisor = divisor; divisor = newDivisor; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.DIVISION_OP__DIVISOR, oldDivisor, newDivisor); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDivisor(Expression newDivisor) { if (newDivisor != divisor) { NotificationChain msgs = null; if (divisor != null) msgs = ((InternalEObject)divisor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.DIVISION_OP__DIVISOR, null, msgs); if (newDivisor != null) msgs = ((InternalEObject)newDivisor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.DIVISION_OP__DIVISOR, null, msgs); msgs = basicSetDivisor(newDivisor, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.DIVISION_OP__DIVISOR, newDivisor, newDivisor)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AstPackage.DIVISION_OP__DIVIDEND: return basicSetDividend(null, msgs); case AstPackage.DIVISION_OP__DIVISOR: return basicSetDivisor(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.DIVISION_OP__DIVIDEND: return getDividend(); case AstPackage.DIVISION_OP__DIVISOR: return getDivisor(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.DIVISION_OP__DIVIDEND: setDividend((Expression)newValue); return; case AstPackage.DIVISION_OP__DIVISOR: setDivisor((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case AstPackage.DIVISION_OP__DIVIDEND: setDividend((Expression)null); return; case AstPackage.DIVISION_OP__DIVISOR: setDivisor((Expression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.DIVISION_OP__DIVIDEND: return dividend != null; case AstPackage.DIVISION_OP__DIVISOR: return divisor != null; } return super.eIsSet(featureID); } } //DivisionOpImpl