/** * <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.RangeExpression; 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>Range Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.sf.etl.samples.ej.ast.impl.RangeExpressionImpl#getInitial <em>Initial</em>}</li> * <li>{@link net.sf.etl.samples.ej.ast.impl.RangeExpressionImpl#getLimit <em>Limit</em>}</li> * </ul> * </p> * * @generated */ public class RangeExpressionImpl extends ExpressionImpl implements RangeExpression { /** * The cached value of the '{@link #getInitial() <em>Initial</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getInitial() * @generated * @ordered */ protected Expression initial = null; /** * The cached value of the '{@link #getLimit() <em>Limit</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLimit() * @generated * @ordered */ protected Expression limit = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected RangeExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return AstPackage.Literals.RANGE_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getInitial() { return initial; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetInitial(Expression newInitial, NotificationChain msgs) { Expression oldInitial = initial; initial = newInitial; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.RANGE_EXPRESSION__INITIAL, oldInitial, newInitial); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setInitial(Expression newInitial) { if (newInitial != initial) { NotificationChain msgs = null; if (initial != null) msgs = ((InternalEObject)initial).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.RANGE_EXPRESSION__INITIAL, null, msgs); if (newInitial != null) msgs = ((InternalEObject)newInitial).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.RANGE_EXPRESSION__INITIAL, null, msgs); msgs = basicSetInitial(newInitial, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.RANGE_EXPRESSION__INITIAL, newInitial, newInitial)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getLimit() { return limit; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetLimit(Expression newLimit, NotificationChain msgs) { Expression oldLimit = limit; limit = newLimit; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.RANGE_EXPRESSION__LIMIT, oldLimit, newLimit); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLimit(Expression newLimit) { if (newLimit != limit) { NotificationChain msgs = null; if (limit != null) msgs = ((InternalEObject)limit).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.RANGE_EXPRESSION__LIMIT, null, msgs); if (newLimit != null) msgs = ((InternalEObject)newLimit).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.RANGE_EXPRESSION__LIMIT, null, msgs); msgs = basicSetLimit(newLimit, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.RANGE_EXPRESSION__LIMIT, newLimit, newLimit)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AstPackage.RANGE_EXPRESSION__INITIAL: return basicSetInitial(null, msgs); case AstPackage.RANGE_EXPRESSION__LIMIT: return basicSetLimit(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.RANGE_EXPRESSION__INITIAL: return getInitial(); case AstPackage.RANGE_EXPRESSION__LIMIT: return getLimit(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.RANGE_EXPRESSION__INITIAL: setInitial((Expression)newValue); return; case AstPackage.RANGE_EXPRESSION__LIMIT: setLimit((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case AstPackage.RANGE_EXPRESSION__INITIAL: setInitial((Expression)null); return; case AstPackage.RANGE_EXPRESSION__LIMIT: setLimit((Expression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.RANGE_EXPRESSION__INITIAL: return initial != null; case AstPackage.RANGE_EXPRESSION__LIMIT: return limit != null; } return super.eIsSet(featureID); } } //RangeExpressionImpl