/** * <copyright> * </copyright> * * $Id$ */ package no.hal.scxml.scxmlxt.impl; import no.hal.scxml.scxmlxt.Expression; import no.hal.scxml.scxmlxt.ScxmlxtPackage; import no.hal.scxml.scxmlxt.SymbolicAction; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Symbolic Action</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link no.hal.scxml.scxmlxt.impl.SymbolicActionImpl#getName <em>Name</em>}</li> * <li>{@link no.hal.scxml.scxmlxt.impl.SymbolicActionImpl#getDelay <em>Delay</em>}</li> * </ul> * </p> * * @generated */ public class SymbolicActionImpl extends ActionImpl implements SymbolicAction { /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getDelay() <em>Delay</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDelay() * @generated * @ordered */ protected Expression delay; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SymbolicActionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ScxmlxtPackage.Literals.SYMBOLIC_ACTION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.SYMBOLIC_ACTION__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Expression getDelay() { return delay; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetDelay(Expression newDelay, NotificationChain msgs) { Expression oldDelay = delay; delay = newDelay; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.SYMBOLIC_ACTION__DELAY, oldDelay, newDelay); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDelay(Expression newDelay) { if (newDelay != delay) { NotificationChain msgs = null; if (delay != null) msgs = ((InternalEObject)delay).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.SYMBOLIC_ACTION__DELAY, null, msgs); if (newDelay != null) msgs = ((InternalEObject)newDelay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.SYMBOLIC_ACTION__DELAY, null, msgs); msgs = basicSetDelay(newDelay, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.SYMBOLIC_ACTION__DELAY, newDelay, newDelay)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ScxmlxtPackage.SYMBOLIC_ACTION__DELAY: return basicSetDelay(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.SYMBOLIC_ACTION__NAME: return getName(); case ScxmlxtPackage.SYMBOLIC_ACTION__DELAY: return getDelay(); } 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.SYMBOLIC_ACTION__NAME: setName((String)newValue); return; case ScxmlxtPackage.SYMBOLIC_ACTION__DELAY: setDelay((Expression)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ScxmlxtPackage.SYMBOLIC_ACTION__NAME: setName(NAME_EDEFAULT); return; case ScxmlxtPackage.SYMBOLIC_ACTION__DELAY: setDelay((Expression)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ScxmlxtPackage.SYMBOLIC_ACTION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case ScxmlxtPackage.SYMBOLIC_ACTION__DELAY: return delay != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //SymbolicActionImpl