diff options
Diffstat (limited to 'rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java')
-rw-r--r-- | rba.model.core/src/rba/core/impl/ArbitrationPolicyExpressionImpl.java | 193 |
1 files changed, 193 insertions, 0 deletions
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; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Arbitration Policy Expression</b></em>'. <!-- + * end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link rba.core.impl.ArbitrationPolicyExpressionImpl#getValue <em>Value</em>}</li> + * </ul> + * + * @generated + */ +public class ArbitrationPolicyExpressionImpl extends EnumExpressionImpl implements ArbitrationPolicyExpression { + /** + * The default value of the '{@link #getValue() <em>Value</em>}' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @see #getValue() + * @generated + * @ordered + */ + protected static final ArbitrationPolicy VALUE_EDEFAULT = ArbitrationPolicy.DEFAULT; + + /** + * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @see #getValue() + * @generated + * @ordered + */ + protected ArbitrationPolicy value = VALUE_EDEFAULT; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected ArbitrationPolicyExpressionImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RBACorePackage.Literals.ARBITRATION_POLICY_EXPRESSION; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public ArbitrationPolicy getValue() { + return value; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @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)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public String getExpressionText() { + if (value instanceof ArbitrationPolicy) { + return value.getName(); + } else { + return "[Invalid_Expression]"; + } + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + public Enumerator getExpressionValue() { + return value; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @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); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @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); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION__VALUE: + return value != VALUE_EDEFAULT; + } + 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.ARBITRATION_POLICY_EXPRESSION___GET_EXPRESSION_TEXT: + return getExpressionText(); + case RBACorePackage.ARBITRATION_POLICY_EXPRESSION___GET_EXPRESSION_VALUE: + return getExpressionValue(); + } + return super.eInvoke(operationID, arguments); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @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 |