/******************************************************************************* * Copyright (c) 2010 Martin Schnabel <mb0@mb0.org>. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.axdt.as3.model.impl; import org.axdt.as3.As3EPackage; import org.axdt.as3.model.As3BinaryExpression; import org.axdt.as3.model.IExpression; 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>As3 Binary Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.axdt.as3.model.impl.As3BinaryExpressionImpl#getLeft <em>Left</em>}</li> * <li>{@link org.axdt.as3.model.impl.As3BinaryExpressionImpl#getOperation <em>Operation</em>}</li> * <li>{@link org.axdt.as3.model.impl.As3BinaryExpressionImpl#getRight <em>Right</em>}</li> * </ul> * </p> * * @generated */ public abstract class As3BinaryExpressionImpl extends IExpressionImpl implements As3BinaryExpression { /** * The cached value of the '{@link #getLeft() <em>Left</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLeft() * @generated * @ordered */ protected IExpression left; /** * The default value of the '{@link #getOperation() <em>Operation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOperation() * @generated * @ordered */ protected static final String OPERATION_EDEFAULT = null; /** * The cached value of the '{@link #getOperation() <em>Operation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOperation() * @generated * @ordered */ protected String operation = OPERATION_EDEFAULT; /** * The cached value of the '{@link #getRight() <em>Right</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRight() * @generated * @ordered */ protected IExpression right; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected As3BinaryExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return As3EPackage.Literals.AS3_BINARY_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IExpression getLeft() { return left; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetLeft(IExpression newLeft, NotificationChain msgs) { IExpression oldLeft = left; left = newLeft; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_BINARY_EXPRESSION__LEFT, oldLeft, newLeft); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLeft(IExpression newLeft) { if (newLeft != left) { NotificationChain msgs = null; if (left != null) msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - As3EPackage.AS3_BINARY_EXPRESSION__LEFT, null, msgs); if (newLeft != null) msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - As3EPackage.AS3_BINARY_EXPRESSION__LEFT, null, msgs); msgs = basicSetLeft(newLeft, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_BINARY_EXPRESSION__LEFT, newLeft, newLeft)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getOperation() { return operation; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setOperation(String newOperation) { String oldOperation = operation; operation = newOperation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_BINARY_EXPRESSION__OPERATION, oldOperation, operation)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IExpression getRight() { return right; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetRight(IExpression newRight, NotificationChain msgs) { IExpression oldRight = right; right = newRight; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_BINARY_EXPRESSION__RIGHT, oldRight, newRight); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRight(IExpression newRight) { if (newRight != right) { NotificationChain msgs = null; if (right != null) msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - As3EPackage.AS3_BINARY_EXPRESSION__RIGHT, null, msgs); if (newRight != null) msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - As3EPackage.AS3_BINARY_EXPRESSION__RIGHT, null, msgs); msgs = basicSetRight(newRight, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, As3EPackage.AS3_BINARY_EXPRESSION__RIGHT, newRight, newRight)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case As3EPackage.AS3_BINARY_EXPRESSION__LEFT: return basicSetLeft(null, msgs); case As3EPackage.AS3_BINARY_EXPRESSION__RIGHT: return basicSetRight(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 As3EPackage.AS3_BINARY_EXPRESSION__LEFT: return getLeft(); case As3EPackage.AS3_BINARY_EXPRESSION__OPERATION: return getOperation(); case As3EPackage.AS3_BINARY_EXPRESSION__RIGHT: return getRight(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case As3EPackage.AS3_BINARY_EXPRESSION__LEFT: setLeft((IExpression)newValue); return; case As3EPackage.AS3_BINARY_EXPRESSION__OPERATION: setOperation((String)newValue); return; case As3EPackage.AS3_BINARY_EXPRESSION__RIGHT: setRight((IExpression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case As3EPackage.AS3_BINARY_EXPRESSION__LEFT: setLeft((IExpression)null); return; case As3EPackage.AS3_BINARY_EXPRESSION__OPERATION: setOperation(OPERATION_EDEFAULT); return; case As3EPackage.AS3_BINARY_EXPRESSION__RIGHT: setRight((IExpression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case As3EPackage.AS3_BINARY_EXPRESSION__LEFT: return left != null; case As3EPackage.AS3_BINARY_EXPRESSION__OPERATION: return OPERATION_EDEFAULT == null ? operation != null : !OPERATION_EDEFAULT.equals(operation); case As3EPackage.AS3_BINARY_EXPRESSION__RIGHT: return right != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (operation: "); result.append(operation); result.append(')'); return result.toString(); } } //As3BinaryExpressionImpl