/** */ package org.xtest.xTest.impl; 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; import org.eclipse.xtext.xbase.XExpression; import org.eclipse.xtext.xbase.impl.XExpressionImpl; import org.xtest.xTest.UniqueName; import org.xtest.xTest.XTestExpression; import org.xtest.xTest.XTestPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.xtest.xTest.impl.XTestExpressionImpl#getName <em>Name</em>}</li> * <li>{@link org.xtest.xTest.impl.XTestExpressionImpl#getExpression <em>Expression</em>}</li> * </ul> * </p> * * @generated */ public class XTestExpressionImpl extends XExpressionImpl implements XTestExpression { /** * The cached value of the '{@link #getName() <em>Name</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected UniqueName name; /** * The cached value of the '{@link #getExpression() <em>Expression</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getExpression() * @generated * @ordered */ protected XExpression expression; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected XTestExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return XTestPackage.Literals.XTEST_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public UniqueName getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetName(UniqueName newName, NotificationChain msgs) { UniqueName oldName = name; name = newName; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XTestPackage.XTEST_EXPRESSION__NAME, oldName, newName); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(UniqueName newName) { if (newName != name) { NotificationChain msgs = null; if (name != null) msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XTestPackage.XTEST_EXPRESSION__NAME, null, msgs); if (newName != null) msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XTestPackage.XTEST_EXPRESSION__NAME, null, msgs); msgs = basicSetName(newName, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XTestPackage.XTEST_EXPRESSION__NAME, newName, newName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public XExpression getExpression() { return expression; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetExpression(XExpression newExpression, NotificationChain msgs) { XExpression oldExpression = expression; expression = newExpression; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XTestPackage.XTEST_EXPRESSION__EXPRESSION, oldExpression, newExpression); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setExpression(XExpression newExpression) { if (newExpression != expression) { NotificationChain msgs = null; if (expression != null) msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XTestPackage.XTEST_EXPRESSION__EXPRESSION, null, msgs); if (newExpression != null) msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XTestPackage.XTEST_EXPRESSION__EXPRESSION, null, msgs); msgs = basicSetExpression(newExpression, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XTestPackage.XTEST_EXPRESSION__EXPRESSION, newExpression, newExpression)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case XTestPackage.XTEST_EXPRESSION__NAME: return basicSetName(null, msgs); case XTestPackage.XTEST_EXPRESSION__EXPRESSION: return basicSetExpression(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 XTestPackage.XTEST_EXPRESSION__NAME: return getName(); case XTestPackage.XTEST_EXPRESSION__EXPRESSION: return getExpression(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case XTestPackage.XTEST_EXPRESSION__NAME: setName((UniqueName)newValue); return; case XTestPackage.XTEST_EXPRESSION__EXPRESSION: setExpression((XExpression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case XTestPackage.XTEST_EXPRESSION__NAME: setName((UniqueName)null); return; case XTestPackage.XTEST_EXPRESSION__EXPRESSION: setExpression((XExpression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case XTestPackage.XTEST_EXPRESSION__NAME: return name != null; case XTestPackage.XTEST_EXPRESSION__EXPRESSION: return expression != null; } return super.eIsSet(featureID); } } //XTestExpressionImpl