/**
*/
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:
*
*
* - {@link rba.core.impl.ArbitrationPolicyExpressionImpl#getValue Value}
*
*
* @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