/** * <copyright> * </copyright> * * $Id$ */ package no.hal.scxml.scxmlxt.impl; import no.hal.scxml.scxmlxt.AbstractTransition; import no.hal.scxml.scxmlxt.Action; import no.hal.scxml.scxmlxt.Condition; import no.hal.scxml.scxmlxt.Event; import no.hal.scxml.scxmlxt.ScxmlxtPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Abstract Transition</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link no.hal.scxml.scxmlxt.impl.AbstractTransitionImpl#getEvent <em>Event</em>}</li> * <li>{@link no.hal.scxml.scxmlxt.impl.AbstractTransitionImpl#getCondition <em>Condition</em>}</li> * <li>{@link no.hal.scxml.scxmlxt.impl.AbstractTransitionImpl#getAction <em>Action</em>}</li> * </ul> * </p> * * @generated */ public abstract class AbstractTransitionImpl extends EObjectImpl implements AbstractTransition { /** * The cached value of the '{@link #getEvent() <em>Event</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getEvent() * @generated * @ordered */ protected Event event; /** * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getCondition() * @generated * @ordered */ protected Condition condition; /** * The cached value of the '{@link #getAction() <em>Action</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAction() * @generated * @ordered */ protected Action action; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AbstractTransitionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ScxmlxtPackage.Literals.ABSTRACT_TRANSITION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Event getEvent() { return event; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetEvent(Event newEvent, NotificationChain msgs) { Event oldEvent = event; event = newEvent; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT, oldEvent, newEvent); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setEvent(Event newEvent) { if (newEvent != event) { NotificationChain msgs = null; if (event != null) msgs = ((InternalEObject)event).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT, null, msgs); if (newEvent != null) msgs = ((InternalEObject)newEvent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT, null, msgs); msgs = basicSetEvent(newEvent, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT, newEvent, newEvent)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Condition getCondition() { return condition; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetCondition(Condition newCondition, NotificationChain msgs) { Condition oldCondition = condition; condition = newCondition; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION, oldCondition, newCondition); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setCondition(Condition newCondition) { if (newCondition != condition) { NotificationChain msgs = null; if (condition != null) msgs = ((InternalEObject)condition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION, null, msgs); if (newCondition != null) msgs = ((InternalEObject)newCondition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION, null, msgs); msgs = basicSetCondition(newCondition, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION, newCondition, newCondition)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Action getAction() { return action; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetAction(Action newAction, NotificationChain msgs) { Action oldAction = action; action = newAction; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION, oldAction, newAction); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAction(Action newAction) { if (newAction != action) { NotificationChain msgs = null; if (action != null) msgs = ((InternalEObject)action).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION, null, msgs); if (newAction != null) msgs = ((InternalEObject)newAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION, null, msgs); msgs = basicSetAction(newAction, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION, newAction, newAction)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT: return basicSetEvent(null, msgs); case ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION: return basicSetCondition(null, msgs); case ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION: return basicSetAction(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT: return getEvent(); case ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION: return getCondition(); case ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION: return getAction(); } 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.ABSTRACT_TRANSITION__EVENT: setEvent((Event)newValue); return; case ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION: setCondition((Condition)newValue); return; case ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION: setAction((Action)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT: setEvent((Event)null); return; case ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION: setCondition((Condition)null); return; case ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION: setAction((Action)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ScxmlxtPackage.ABSTRACT_TRANSITION__EVENT: return event != null; case ScxmlxtPackage.ABSTRACT_TRANSITION__CONDITION: return condition != null; case ScxmlxtPackage.ABSTRACT_TRANSITION__ACTION: return action != null; } return super.eIsSet(featureID); } } //AbstractTransitionImpl