/** * generated by Xtext 2.13.0 */ package com.minres.rdl.rdl.impl; import com.minres.rdl.rdl.Entity; import com.minres.rdl.rdl.InstanceRef; import com.minres.rdl.rdl.RdlPackage; 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.MinimalEObjectImpl; /** * * An implementation of the model object 'Instance Ref'. * *

* The following features are implemented: *

* * * @generated */ public class InstanceRefImpl extends MinimalEObjectImpl.Container implements InstanceRef { /** * The cached value of the '{@link #getInstance() Instance}' reference. * * * @see #getInstance() * @generated * @ordered */ protected Entity instance; /** * The cached value of the '{@link #getTail() Tail}' containment reference. * * * @see #getTail() * @generated * @ordered */ protected InstanceRef tail; /** * * * @generated */ protected InstanceRefImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return RdlPackage.Literals.INSTANCE_REF; } /** * * * @generated */ public Entity getInstance() { if (instance != null && instance.eIsProxy()) { InternalEObject oldInstance = (InternalEObject)instance; instance = (Entity)eResolveProxy(oldInstance); if (instance != oldInstance) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, RdlPackage.INSTANCE_REF__INSTANCE, oldInstance, instance)); } } return instance; } /** * * * @generated */ public Entity basicGetInstance() { return instance; } /** * * * @generated */ public void setInstance(Entity newInstance) { Entity oldInstance = instance; instance = newInstance; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.INSTANCE_REF__INSTANCE, oldInstance, instance)); } /** * * * @generated */ public InstanceRef getTail() { return tail; } /** * * * @generated */ public NotificationChain basicSetTail(InstanceRef newTail, NotificationChain msgs) { InstanceRef oldTail = tail; tail = newTail; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RdlPackage.INSTANCE_REF__TAIL, oldTail, newTail); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setTail(InstanceRef newTail) { if (newTail != tail) { NotificationChain msgs = null; if (tail != null) msgs = ((InternalEObject)tail).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RdlPackage.INSTANCE_REF__TAIL, null, msgs); if (newTail != null) msgs = ((InternalEObject)newTail).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RdlPackage.INSTANCE_REF__TAIL, null, msgs); msgs = basicSetTail(newTail, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.INSTANCE_REF__TAIL, newTail, newTail)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case RdlPackage.INSTANCE_REF__TAIL: return basicSetTail(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case RdlPackage.INSTANCE_REF__INSTANCE: if (resolve) return getInstance(); return basicGetInstance(); case RdlPackage.INSTANCE_REF__TAIL: return getTail(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case RdlPackage.INSTANCE_REF__INSTANCE: setInstance((Entity)newValue); return; case RdlPackage.INSTANCE_REF__TAIL: setTail((InstanceRef)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case RdlPackage.INSTANCE_REF__INSTANCE: setInstance((Entity)null); return; case RdlPackage.INSTANCE_REF__TAIL: setTail((InstanceRef)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case RdlPackage.INSTANCE_REF__INSTANCE: return instance != null; case RdlPackage.INSTANCE_REF__TAIL: return tail != null; } return super.eIsSet(featureID); } } //InstanceRefImpl