/**
* <copyright>
* </copyright>
*
* $Id$
*/
package no.hal.scxml.scxmlxt.impl;
import no.hal.scxml.scxmlxt.ScxmlxtPackage;
import no.hal.scxml.scxmlxt.VarDef;
import no.hal.scxml.scxmlxt.VarRef;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Var Ref</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link no.hal.scxml.scxmlxt.impl.VarRefImpl#getVar <em>Var</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class VarRefImpl extends ExpressionImpl implements VarRef {
/**
* The cached value of the '{@link #getVar() <em>Var</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVar()
* @generated
* @ordered
*/
protected VarDef var;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected VarRefImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ScxmlxtPackage.Literals.VAR_REF;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VarDef getVar() {
if (var != null && var.eIsProxy()) {
InternalEObject oldVar = (InternalEObject)var;
var = (VarDef)eResolveProxy(oldVar);
if (var != oldVar) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ScxmlxtPackage.VAR_REF__VAR, oldVar, var));
}
}
return var;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VarDef basicGetVar() {
return var;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVar(VarDef newVar) {
VarDef oldVar = var;
var = newVar;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.VAR_REF__VAR, oldVar, var));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ScxmlxtPackage.VAR_REF__VAR:
if (resolve) return getVar();
return basicGetVar();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ScxmlxtPackage.VAR_REF__VAR:
setVar((VarDef)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ScxmlxtPackage.VAR_REF__VAR:
setVar((VarDef)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ScxmlxtPackage.VAR_REF__VAR:
return var != null;
}
return super.eIsSet(featureID);
}
} //VarRefImpl