From 250722c453223a238192fda8db9e692ea776afc7 Mon Sep 17 00:00:00 2001 From: ArenBabikian Date: Sun, 19 May 2019 04:57:59 -0400 Subject: REALMET: first impl of n'hood visualis. minor bug with adding outgng 0s. --- .../src/linkedList/impl/ListImpl.java | 176 +++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java') diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java new file mode 100644 index 00000000..30d006cd --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ListImpl.java @@ -0,0 +1,176 @@ +/** + */ +package linkedList.impl; + +import linkedList.Element; +import linkedList.LinkedListPackage; +import linkedList.List; + +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 'List'. + * + *

+ * The following features are implemented: + *

+ * + * + * @generated + */ +public class ListImpl extends MinimalEObjectImpl.Container implements List { + /** + * The cached value of the '{@link #getFirst() First}' containment reference. + * + * + * @see #getFirst() + * @generated + * @ordered + */ + protected Element first; + + /** + * + * + * @generated + */ + protected ListImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return LinkedListPackage.Literals.LIST; + } + + /** + * + * + * @generated + */ + public Element getFirst() { + return first; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetFirst(Element newFirst, NotificationChain msgs) { + Element oldFirst = first; + first = newFirst; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.LIST__FIRST, oldFirst, newFirst); + if (msgs == null) msgs = notification; else msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + public void setFirst(Element newFirst) { + if (newFirst != first) { + NotificationChain msgs = null; + if (first != null) + msgs = ((InternalEObject)first).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.LIST__FIRST, null, msgs); + if (newFirst != null) + msgs = ((InternalEObject)newFirst).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.LIST__FIRST, null, msgs); + msgs = basicSetFirst(newFirst, msgs); + if (msgs != null) msgs.dispatch(); + } + else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.LIST__FIRST, newFirst, newFirst)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case LinkedListPackage.LIST__FIRST: + return basicSetFirst(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case LinkedListPackage.LIST__FIRST: + return getFirst(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case LinkedListPackage.LIST__FIRST: + setFirst((Element)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case LinkedListPackage.LIST__FIRST: + setFirst((Element)null); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case LinkedListPackage.LIST__FIRST: + return first != null; + } + return super.eIsSet(featureID); + } + +} //ListImpl -- cgit v1.2.3-54-g00ecf