summaryrefslogtreecommitdiffstats
path: root/rba.model.core/src/rba/core/impl/LetStatementImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'rba.model.core/src/rba/core/impl/LetStatementImpl.java')
-rw-r--r--rba.model.core/src/rba/core/impl/LetStatementImpl.java268
1 files changed, 268 insertions, 0 deletions
diff --git a/rba.model.core/src/rba/core/impl/LetStatementImpl.java b/rba.model.core/src/rba/core/impl/LetStatementImpl.java
new file mode 100644
index 0000000..53f62aa
--- /dev/null
+++ b/rba.model.core/src/rba/core/impl/LetStatementImpl.java
@@ -0,0 +1,268 @@
+/**
+ */
+package rba.core.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import rba.core.Expression;
+import rba.core.LetStatement;
+import rba.core.RBACorePackage;
+import rba.core.Variable;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Let Statement</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ * <li>{@link rba.core.impl.LetStatementImpl#getVariable <em>Variable</em>}</li>
+ * <li>{@link rba.core.impl.LetStatementImpl#getBody <em>Body</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public class LetStatementImpl extends ModelElementImpl implements LetStatement {
+ /**
+ * The cached value of the '{@link #getVariable() <em>Variable</em>}' containment reference.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see #getVariable()
+ * @generated
+ * @ordered
+ */
+ protected Variable variable;
+
+ /**
+ * The cached value of the '{@link #getBody() <em>Body</em>}' containment reference.
+ * <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ * @see #getBody()
+ * @generated
+ * @ordered
+ */
+ protected Expression body;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ protected LetStatementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return RBACorePackage.Literals.LET_STATEMENT;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public Variable getVariable() {
+ return variable;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetVariable(Variable newVariable, NotificationChain msgs) {
+ Variable oldVariable = variable;
+ variable = newVariable;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
+ RBACorePackage.LET_STATEMENT__VARIABLE, oldVariable, newVariable);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public void setVariable(Variable newVariable) {
+ if (newVariable != variable) {
+ NotificationChain msgs = null;
+ if (variable != null)
+ msgs = ((InternalEObject) variable).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - RBACorePackage.LET_STATEMENT__VARIABLE, null, msgs);
+ if (newVariable != null)
+ msgs = ((InternalEObject) newVariable).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - RBACorePackage.LET_STATEMENT__VARIABLE, null, msgs);
+ msgs = basicSetVariable(newVariable, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.LET_STATEMENT__VARIABLE, newVariable,
+ newVariable));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public Expression getBody() {
+ return body;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetBody(Expression newBody, NotificationChain msgs) {
+ Expression oldBody = body;
+ body = newBody;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
+ RBACorePackage.LET_STATEMENT__BODY, oldBody, newBody);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public void setBody(Expression newBody) {
+ if (newBody != body) {
+ NotificationChain msgs = null;
+ if (body != null)
+ msgs = ((InternalEObject) body).eInverseRemove(this,
+ EOPPOSITE_FEATURE_BASE - RBACorePackage.LET_STATEMENT__BODY, null, msgs);
+ if (newBody != null)
+ msgs = ((InternalEObject) newBody).eInverseAdd(this,
+ EOPPOSITE_FEATURE_BASE - RBACorePackage.LET_STATEMENT__BODY, null, msgs);
+ msgs = basicSetBody(newBody, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ } else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.LET_STATEMENT__BODY, newBody,
+ newBody));
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString() {
+ StringBuilder ret = new StringBuilder();
+ ret.append("let "); //$NON-NLS-1$
+ ret.append(getVariable().getName());
+ ret.append("= "); //$NON-NLS-1$
+ ret.append(getBody().getExpressionText());
+ return ret.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case RBACorePackage.LET_STATEMENT__VARIABLE:
+ return basicSetVariable(null, msgs);
+ case RBACorePackage.LET_STATEMENT__BODY:
+ return basicSetBody(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 RBACorePackage.LET_STATEMENT__VARIABLE:
+ return getVariable();
+ case RBACorePackage.LET_STATEMENT__BODY:
+ return getBody();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case RBACorePackage.LET_STATEMENT__VARIABLE:
+ setVariable((Variable) newValue);
+ return;
+ case RBACorePackage.LET_STATEMENT__BODY:
+ setBody((Expression) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case RBACorePackage.LET_STATEMENT__VARIABLE:
+ setVariable((Variable) null);
+ return;
+ case RBACorePackage.LET_STATEMENT__BODY:
+ setBody((Expression) null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case RBACorePackage.LET_STATEMENT__VARIABLE:
+ return variable != null;
+ case RBACorePackage.LET_STATEMENT__BODY:
+ return body != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+ switch (operationID) {
+ case RBACorePackage.LET_STATEMENT___TO_STRING:
+ return toString();
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} // LetStatementImpl