From be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 Mon Sep 17 00:00:00 2001 From: Kenji Hosokawa Date: Tue, 3 Aug 2021 18:42:39 +0900 Subject: Initial commit Bug-AGL: SPEC-4033 Signed-off-by: Kenji Hosokawa --- .../core/impl/ArbitrationPolicyExpressionImpl.java | 193 +++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java (limited to 'rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java') diff --git a/rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java b/rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java new file mode 100644 index 0000000..a9d7764 --- /dev/null +++ b/rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java @@ -0,0 +1,193 @@ +/** + */ +package rba.core.impl; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.Enumerator; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import rba.core.ArbitrationPolicy; +import rba.core.ArbitrationPolicyExpression; +import rba.core.RBACorePackage; + +/** + * An implementation of the model object 'Arbitration Policy Expression'. + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ArbitrationPolicyExpressionImpl extends EnumExpressionImpl implements ArbitrationPolicyExpression { + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final ArbitrationPolicy VALUE_EDEFAULT = ArbitrationPolicy.DEFAULT; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * @see #getValue() + * @generated + * @ordered + */ + protected ArbitrationPolicy value = VALUE_EDEFAULT; + + /** + * + * @generated + */ + protected ArbitrationPolicyExpressionImpl() { + super(); + } + + /** + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBACorePackage.Literals.ARBITRATION_POLICY_EXPRESSION; + } + + /** + * + * @generated + */ + public ArbitrationPolicy getValue() { + return value; + } + + /** + * + * @generated + */ + public void setValue(ArbitrationPolicy newValue) { + ArbitrationPolicy oldValue = value; + value = newValue == null ? VALUE_EDEFAULT : newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE, + oldValue, value)); + } + + /** + * + * @generated + */ + public String getExpressionText() { + if (value instanceof ArbitrationPolicy) { + return value.getName(); + } else { + return "[Invalid_Expression]"; + } + } + + /** + * + * @generated + */ + public Enumerator getExpressionValue() { + return value; + } + + /** + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + setValue((ArbitrationPolicy) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + return value != VALUE_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * + * @generated + */ + @Override + public Object eInvoke(int operationID, EList arguments) throws InvocationTargetException { + switch (operationID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION___GET_EXPRESSION_TEXT: + return getExpressionText(); + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION___GET_EXPRESSION_VALUE: + return getExpressionValue(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (value: "); + result.append(value); + result.append(')'); + return result.toString(); + } + +} // ArbitrationPolicyExpressionImpl -- cgit 1.2.3-korg