/**
*/
package fr.inria.diverse.iot2.iot2.iot2.impl;
import fr.inria.diverse.iot2.iot2.iot2.BooleanVariable;
import fr.inria.diverse.iot2.iot2.iot2.ControlFlow;
import fr.inria.diverse.iot2.iot2.iot2.Iot2Package;
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>Control Flow</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link fr.inria.diverse.iot2.iot2.iot2.impl.ControlFlowImpl#getGuard <em>Guard</em>}</li>
* </ul>
*
* @generated
*/
public class ControlFlowImpl extends ActivityEdgeImpl implements ControlFlow {
/**
* The cached value of the '{@link #getGuard() <em>Guard</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getGuard()
* @generated
* @ordered
*/
protected BooleanVariable guard;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ControlFlowImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Iot2Package.Literals.CONTROL_FLOW;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BooleanVariable getGuard() {
if (guard != null && guard.eIsProxy()) {
InternalEObject oldGuard = (InternalEObject)guard;
guard = (BooleanVariable)eResolveProxy(oldGuard);
if (guard != oldGuard) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Iot2Package.CONTROL_FLOW__GUARD, oldGuard, guard));
}
}
return guard;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BooleanVariable basicGetGuard() {
return guard;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setGuard(BooleanVariable newGuard) {
BooleanVariable oldGuard = guard;
guard = newGuard;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Iot2Package.CONTROL_FLOW__GUARD, oldGuard, guard));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Iot2Package.CONTROL_FLOW__GUARD:
if (resolve) return getGuard();
return basicGetGuard();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Iot2Package.CONTROL_FLOW__GUARD:
setGuard((BooleanVariable)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Iot2Package.CONTROL_FLOW__GUARD:
setGuard((BooleanVariable)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Iot2Package.CONTROL_FLOW__GUARD:
return guard != null;
}
return super.eIsSet(featureID);
}
} //ControlFlowImpl