/**
*/
package rba.core.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import rba.core.Expression;
import rba.core.Operator;
import rba.core.RBACorePackage;
/**
* An implementation of the model object 'Operator'.
*
* The following features are implemented:
*
*
* - {@link rba.core.impl.OperatorImpl#getOperand Operand}
*
*
* @generated
*/
public abstract class OperatorImpl extends ExpressionImpl implements Operator {
/**
* The cached value of the '{@link #getOperand() Operand}' containment reference list.
*
* @see #getOperand()
* @generated
* @ordered
*/
protected EList operand;
/**
*
* @generated
*/
protected OperatorImpl() {
super();
}
/**
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RBACorePackage.Literals.OPERATOR;
}
/**
*
* @generated
*/
public EList getOperand() {
if (operand == null) {
operand = new EObjectContainmentEList(Expression.class, this, RBACorePackage.OPERATOR__OPERAND);
}
return operand;
}
/**
*
* @generated
*/
public String getSymbol() {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RBACorePackage.OPERATOR__OPERAND:
return ((InternalEList>) getOperand()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RBACorePackage.OPERATOR__OPERAND:
return getOperand();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RBACorePackage.OPERATOR__OPERAND:
getOperand().clear();
getOperand().addAll((Collection extends Expression>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RBACorePackage.OPERATOR__OPERAND:
getOperand().clear();
return;
}
super.eUnset(featureID);
}
/**
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RBACorePackage.OPERATOR__OPERAND:
return operand != null && !operand.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
* @generated
*/
@Override
public Object eInvoke(int operationID, EList> arguments) throws InvocationTargetException {
switch (operationID) {
case RBACorePackage.OPERATOR___GET_SYMBOL:
return getSymbol();
}
return super.eInvoke(operationID, arguments);
}
} // OperatorImpl