/** * <copyright> * </copyright> * * $Id$ */ package no.hal.scxml.scxmlxt.impl; import no.hal.scxml.scxmlxt.EStep; import no.hal.scxml.scxmlxt.EStepFilter; 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>EPath Step</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link no.hal.scxml.scxmlxt.impl.EStepImpl#getFeatureName <em>Feature Name</em>}</li> * <li>{@link no.hal.scxml.scxmlxt.impl.EStepImpl#getFilter <em>Filter</em>}</li> * </ul> * </p> * * @generated */ public class EStepImpl extends EObjectImpl implements EStep { /** * The default value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFeatureName() * @generated * @ordered */ protected static final String FEATURE_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getFeatureName() <em>Feature Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFeatureName() * @generated * @ordered */ protected String featureName = FEATURE_NAME_EDEFAULT; /** * The cached value of the '{@link #getFilter() <em>Filter</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFilter() * @generated * @ordered */ protected EStepFilter filter; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EStepImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ScxmlxtPackage.Literals.ESTEP; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getFeatureName() { return featureName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFeatureName(String newFeatureName) { String oldFeatureName = featureName; featureName = newFeatureName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ESTEP__FEATURE_NAME, oldFeatureName, featureName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EStepFilter getFilter() { return filter; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetFilter(EStepFilter newFilter, NotificationChain msgs) { EStepFilter oldFilter = filter; filter = newFilter; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ESTEP__FILTER, oldFilter, newFilter); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFilter(EStepFilter newFilter) { if (newFilter != filter) { NotificationChain msgs = null; if (filter != null) msgs = ((InternalEObject)filter).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ESTEP__FILTER, null, msgs); if (newFilter != null) msgs = ((InternalEObject)newFilter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.ESTEP__FILTER, null, msgs); msgs = basicSetFilter(newFilter, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.ESTEP__FILTER, newFilter, newFilter)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ScxmlxtPackage.ESTEP__FILTER: return basicSetFilter(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.ESTEP__FEATURE_NAME: return getFeatureName(); case ScxmlxtPackage.ESTEP__FILTER: return getFilter(); } 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.ESTEP__FEATURE_NAME: setFeatureName((String)newValue); return; case ScxmlxtPackage.ESTEP__FILTER: setFilter((EStepFilter)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ScxmlxtPackage.ESTEP__FEATURE_NAME: setFeatureName(FEATURE_NAME_EDEFAULT); return; case ScxmlxtPackage.ESTEP__FILTER: setFilter((EStepFilter)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ScxmlxtPackage.ESTEP__FEATURE_NAME: return FEATURE_NAME_EDEFAULT == null ? featureName != null : !FEATURE_NAME_EDEFAULT.equals(featureName); case ScxmlxtPackage.ESTEP__FILTER: return filter != 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(" (featureName: "); result.append(featureName); result.append(')'); return result.toString(); } } //EPathStepImpl