/** */ package fr.inria.diverse.iot2.iot2.iot2.impl; import fr.inria.diverse.iot2.iot2.iot2.IntegerCalculationExpression; import fr.inria.diverse.iot2.iot2.iot2.IntegerCalculationOperator; import fr.inria.diverse.iot2.iot2.iot2.IntegerVariable; import fr.inria.diverse.iot2.iot2.iot2.Iot2Package; import org.eclipse.emf.common.notify.Notification; 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>Integer Calculation Expression</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link fr.inria.diverse.iot2.iot2.iot2.impl.IntegerCalculationExpressionImpl#getAssignee <em>Assignee</em>}</li> * <li>{@link fr.inria.diverse.iot2.iot2.iot2.impl.IntegerCalculationExpressionImpl#getOperator <em>Operator</em>}</li> * </ul> * * @generated */ public class IntegerCalculationExpressionImpl extends IntegerExpressionImpl implements IntegerCalculationExpression { /** * The cached value of the '{@link #getAssignee() <em>Assignee</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAssignee() * @generated * @ordered */ protected IntegerVariable assignee; /** * The default value of the '{@link #getOperator() <em>Operator</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOperator() * @generated * @ordered */ protected static final IntegerCalculationOperator OPERATOR_EDEFAULT = IntegerCalculationOperator.ADD; /** * The cached value of the '{@link #getOperator() <em>Operator</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOperator() * @generated * @ordered */ protected IntegerCalculationOperator operator = OPERATOR_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected IntegerCalculationExpressionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return Iot2Package.Literals.INTEGER_CALCULATION_EXPRESSION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerVariable getAssignee() { if (assignee != null && assignee.eIsProxy()) { InternalEObject oldAssignee = (InternalEObject)assignee; assignee = (IntegerVariable)eResolveProxy(oldAssignee); if (assignee != oldAssignee) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE, oldAssignee, assignee)); } } return assignee; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerVariable basicGetAssignee() { return assignee; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAssignee(IntegerVariable newAssignee) { IntegerVariable oldAssignee = assignee; assignee = newAssignee; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE, oldAssignee, assignee)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IntegerCalculationOperator getOperator() { return operator; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setOperator(IntegerCalculationOperator newOperator) { IntegerCalculationOperator oldOperator = operator; operator = newOperator == null ? OPERATOR_EDEFAULT : newOperator; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Iot2Package.INTEGER_CALCULATION_EXPRESSION__OPERATOR, oldOperator, operator)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE: if (resolve) return getAssignee(); return basicGetAssignee(); case Iot2Package.INTEGER_CALCULATION_EXPRESSION__OPERATOR: return getOperator(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE: setAssignee((IntegerVariable)newValue); return; case Iot2Package.INTEGER_CALCULATION_EXPRESSION__OPERATOR: setOperator((IntegerCalculationOperator)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE: setAssignee((IntegerVariable)null); return; case Iot2Package.INTEGER_CALCULATION_EXPRESSION__OPERATOR: setOperator(OPERATOR_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Iot2Package.INTEGER_CALCULATION_EXPRESSION__ASSIGNEE: return assignee != null; case Iot2Package.INTEGER_CALCULATION_EXPRESSION__OPERATOR: return operator != OPERATOR_EDEFAULT; } 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(" (operator: "); result.append(operator); result.append(')'); return result.toString(); } } //IntegerCalculationExpressionImpl