/** * <copyright> * </copyright> * * $Id$ */ package net.sf.etl.samples.ej.ast.impl; import net.sf.etl.samples.ej.ast.AstPackage; import net.sf.etl.samples.ej.ast.Label; import net.sf.etl.samples.ej.ast.LabeledStatement; 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>Labeled Statement</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.sf.etl.samples.ej.ast.impl.LabeledStatementImpl#getLabel <em>Label</em>}</li> * </ul> * </p> * * @generated */ public abstract class LabeledStatementImpl extends MethodContentStatementImpl implements LabeledStatement { /** * The cached value of the '{@link #getLabel() <em>Label</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected Label label = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected LabeledStatementImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return AstPackage.Literals.LABELED_STATEMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Label getLabel() { return label; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetLabel(Label newLabel, NotificationChain msgs) { Label oldLabel = label; label = newLabel; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AstPackage.LABELED_STATEMENT__LABEL, oldLabel, newLabel); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLabel(Label newLabel) { if (newLabel != label) { NotificationChain msgs = null; if (label != null) msgs = ((InternalEObject)label).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AstPackage.LABELED_STATEMENT__LABEL, null, msgs); if (newLabel != null) msgs = ((InternalEObject)newLabel).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AstPackage.LABELED_STATEMENT__LABEL, null, msgs); msgs = basicSetLabel(newLabel, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.LABELED_STATEMENT__LABEL, newLabel, newLabel)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AstPackage.LABELED_STATEMENT__LABEL: return basicSetLabel(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AstPackage.LABELED_STATEMENT__LABEL: return getLabel(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.LABELED_STATEMENT__LABEL: setLabel((Label)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case AstPackage.LABELED_STATEMENT__LABEL: setLabel((Label)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.LABELED_STATEMENT__LABEL: return label != null; } return super.eIsSet(featureID); } } //LabeledStatementImpl