/** */ package edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.impl; import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.AccessExp; import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.Accessor; import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.DeviceModelingLanguagePackage; import edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.PrimaryExp; 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>Access Exp</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.impl.AccessExpImpl#getBase <em>Base</em>}</li> * <li>{@link edu.ksu.cis.projects.mdcf.devicemodel.deviceModelingLanguage.impl.AccessExpImpl#getAccessor <em>Accessor</em>}</li> * </ul> * </p> * * @generated */ public class AccessExpImpl extends ExpImpl implements AccessExp { /** * The cached value of the '{@link #getBase() <em>Base</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getBase() * @generated * @ordered */ protected PrimaryExp base; /** * The cached value of the '{@link #getAccessor() <em>Accessor</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAccessor() * @generated * @ordered */ protected Accessor accessor; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AccessExpImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DeviceModelingLanguagePackage.Literals.ACCESS_EXP; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PrimaryExp getBase() { return base; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetBase(PrimaryExp newBase, NotificationChain msgs) { PrimaryExp oldBase = base; base = newBase; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeviceModelingLanguagePackage.ACCESS_EXP__BASE, oldBase, newBase); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setBase(PrimaryExp newBase) { if (newBase != base) { NotificationChain msgs = null; if (base != null) msgs = ((InternalEObject)base).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeviceModelingLanguagePackage.ACCESS_EXP__BASE, null, msgs); if (newBase != null) msgs = ((InternalEObject)newBase).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeviceModelingLanguagePackage.ACCESS_EXP__BASE, null, msgs); msgs = basicSetBase(newBase, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DeviceModelingLanguagePackage.ACCESS_EXP__BASE, newBase, newBase)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Accessor getAccessor() { if (accessor != null && accessor.eIsProxy()) { InternalEObject oldAccessor = (InternalEObject)accessor; accessor = (Accessor)eResolveProxy(oldAccessor); if (accessor != oldAccessor) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR, oldAccessor, accessor)); } } return accessor; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Accessor basicGetAccessor() { return accessor; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAccessor(Accessor newAccessor) { Accessor oldAccessor = accessor; accessor = newAccessor; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR, oldAccessor, accessor)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DeviceModelingLanguagePackage.ACCESS_EXP__BASE: return basicSetBase(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 DeviceModelingLanguagePackage.ACCESS_EXP__BASE: return getBase(); case DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR: if (resolve) return getAccessor(); return basicGetAccessor(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DeviceModelingLanguagePackage.ACCESS_EXP__BASE: setBase((PrimaryExp)newValue); return; case DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR: setAccessor((Accessor)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DeviceModelingLanguagePackage.ACCESS_EXP__BASE: setBase((PrimaryExp)null); return; case DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR: setAccessor((Accessor)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DeviceModelingLanguagePackage.ACCESS_EXP__BASE: return base != null; case DeviceModelingLanguagePackage.ACCESS_EXP__ACCESSOR: return accessor != null; } return super.eIsSet(featureID); } } //AccessExpImpl