/** */ package linkedList.impl; import linkedList.Element; import linkedList.LinkedListPackage; 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 'Element'. * *

* The following features are implemented: *

* * * @generated */ public class ElementImpl extends MinimalEObjectImpl.Container implements Element { /** * The cached value of the '{@link #getValue() Value}' containment reference. * * * @see #getValue() * @generated * @ordered */ protected linkedList.Object value; /** * The cached value of the '{@link #getNext() Next}' containment reference. * * * @see #getNext() * @generated * @ordered */ protected Element next; /** * * * @generated */ protected ElementImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return LinkedListPackage.Literals.ELEMENT; } /** * * * @generated */ public linkedList.Object getValue() { return value; } /** * * * @generated */ public NotificationChain basicSetValue(linkedList.Object newValue, NotificationChain msgs) { linkedList.Object oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, oldValue, newValue); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setValue(linkedList.Object newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); if (newValue != null) msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); msgs = basicSetValue(newValue, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, newValue, newValue)); } /** * * * @generated */ public Element getNext() { return next; } /** * * * @generated */ public NotificationChain basicSetNext(Element newNext, NotificationChain msgs) { Element oldNext = next; next = newNext; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, oldNext, newNext); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setNext(Element newNext) { if (newNext != next) { NotificationChain msgs = null; if (next != null) msgs = ((InternalEObject)next).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); if (newNext != null) msgs = ((InternalEObject)newNext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); msgs = basicSetNext(newNext, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, newNext, newNext)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case LinkedListPackage.ELEMENT__VALUE: return basicSetValue(null, msgs); case LinkedListPackage.ELEMENT__NEXT: return basicSetNext(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case LinkedListPackage.ELEMENT__VALUE: return getValue(); case LinkedListPackage.ELEMENT__NEXT: return getNext(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case LinkedListPackage.ELEMENT__VALUE: setValue((linkedList.Object)newValue); return; case LinkedListPackage.ELEMENT__NEXT: setNext((Element)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case LinkedListPackage.ELEMENT__VALUE: setValue((linkedList.Object)null); return; case LinkedListPackage.ELEMENT__NEXT: setNext((Element)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case LinkedListPackage.ELEMENT__VALUE: return value != null; case LinkedListPackage.ELEMENT__NEXT: return next != null; } return super.eIsSet(featureID); } } //ElementImpl