/** */ package org.dresdenocl.language.ocl.impl; import org.dresdenocl.language.ocl.ModelElementCS; import org.dresdenocl.language.ocl.OclPackage; import org.dresdenocl.language.ocl.PathNameCS; import org.dresdenocl.pivotmodel.NamedElement; 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>Model Element CS</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.dresdenocl.language.ocl.impl.ModelElementCSImpl#getPathName <em>Path Name</em>}</li> * </ul> * </p> * * @generated */ public class ModelElementCSImpl extends OclExpressionCSImpl implements ModelElementCS { /** * The cached value of the '{@link #getPathName() <em>Path Name</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getPathName() * @generated * @ordered */ protected PathNameCS pathName; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ModelElementCSImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OclPackage.Literals.MODEL_ELEMENT_CS; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PathNameCS getPathName() { return pathName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetPathName(PathNameCS newPathName, NotificationChain msgs) { PathNameCS oldPathName = pathName; pathName = newPathName; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OclPackage.MODEL_ELEMENT_CS__PATH_NAME, oldPathName, newPathName); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setPathName(PathNameCS newPathName) { if (newPathName != pathName) { NotificationChain msgs = null; if (pathName != null) msgs = ((InternalEObject)pathName).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OclPackage.MODEL_ELEMENT_CS__PATH_NAME, null, msgs); if (newPathName != null) msgs = ((InternalEObject)newPathName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OclPackage.MODEL_ELEMENT_CS__PATH_NAME, null, msgs); msgs = basicSetPathName(newPathName, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OclPackage.MODEL_ELEMENT_CS__PATH_NAME, newPathName, newPathName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated NOT */ public NamedElement getNamedElement() { return pathName.getNamedElement(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case OclPackage.MODEL_ELEMENT_CS__PATH_NAME: return basicSetPathName(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 OclPackage.MODEL_ELEMENT_CS__PATH_NAME: return getPathName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OclPackage.MODEL_ELEMENT_CS__PATH_NAME: setPathName((PathNameCS)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OclPackage.MODEL_ELEMENT_CS__PATH_NAME: setPathName((PathNameCS)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OclPackage.MODEL_ELEMENT_CS__PATH_NAME: return pathName != null; } return super.eIsSet(featureID); } } //ModelElementCSImpl