/**
* <copyright>
* </copyright>
*
* $Id$
*/
package simulator.scl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import simulator.scl.ConfigPackage;
import simulator.scl.Displayable;
import simulator.scl.Variable;
import simulator.scl.VariableComparisonCondition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Variable Comparison Condition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link simulator.scl.impl.VariableComparisonConditionImpl#getVariable <em>Variable</em>}</li>
* <li>{@link simulator.scl.impl.VariableComparisonConditionImpl#getValue <em>Value</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class VariableComparisonConditionImpl extends ConditionImpl implements VariableComparisonCondition {
/**
* The cached value of the '{@link #getVariable() <em>Variable</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVariable()
* @generated
* @ordered
*/
protected Variable variable;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected Displayable value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected VariableComparisonConditionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ConfigPackage.Literals.VARIABLE_COMPARISON_CONDITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable getVariable() {
if (variable != null && variable.eIsProxy()) {
InternalEObject oldVariable = (InternalEObject)variable;
variable = (Variable)eResolveProxy(oldVariable);
if (variable != oldVariable) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE, oldVariable, variable));
}
}
return variable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Variable basicGetVariable() {
return variable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVariable(Variable newVariable) {
Variable oldVariable = variable;
variable = newVariable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE, oldVariable, variable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Displayable getValue() {
if (value != null && value.eIsProxy()) {
InternalEObject oldValue = (InternalEObject)value;
value = (Displayable)eResolveProxy(oldValue);
if (value != oldValue) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE, oldValue, value));
}
}
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Displayable basicGetValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(Displayable newValue) {
Displayable oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE:
if (resolve) return getVariable();
return basicGetVariable();
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE:
if (resolve) return getValue();
return basicGetValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE:
setVariable((Variable)newValue);
return;
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE:
setValue((Displayable)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE:
setVariable((Variable)null);
return;
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE:
setValue((Displayable)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VARIABLE:
return variable != null;
case ConfigPackage.VARIABLE_COMPARISON_CONDITION__VALUE:
return value != null;
}
return super.eIsSet(featureID);
}
} //VariableComparisonConditionImpl