diff options
Diffstat (limited to 'Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java')
-rw-r--r-- | Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java new file mode 100644 index 00000000..d08f707b --- /dev/null +++ b/Metrics/ca.mcgill.ecse.dslreasoner.realistic.metrics/src/linkedList/impl/ElementImpl.java | |||
@@ -0,0 +1,241 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package linkedList.impl; | ||
4 | |||
5 | import linkedList.Element; | ||
6 | import linkedList.LinkedListPackage; | ||
7 | |||
8 | import org.eclipse.emf.common.notify.Notification; | ||
9 | import org.eclipse.emf.common.notify.NotificationChain; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model object '<em><b>Element</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link linkedList.impl.ElementImpl#getValue <em>Value</em>}</li> | ||
26 | * <li>{@link linkedList.impl.ElementImpl#getNext <em>Next</em>}</li> | ||
27 | * </ul> | ||
28 | * | ||
29 | * @generated | ||
30 | */ | ||
31 | public class ElementImpl extends MinimalEObjectImpl.Container implements Element { | ||
32 | /** | ||
33 | * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. | ||
34 | * <!-- begin-user-doc --> | ||
35 | * <!-- end-user-doc --> | ||
36 | * @see #getValue() | ||
37 | * @generated | ||
38 | * @ordered | ||
39 | */ | ||
40 | protected linkedList.Object value; | ||
41 | |||
42 | /** | ||
43 | * The cached value of the '{@link #getNext() <em>Next</em>}' containment reference. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getNext() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected Element next; | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | protected ElementImpl() { | ||
58 | super(); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected EClass eStaticClass() { | ||
68 | return LinkedListPackage.Literals.ELEMENT; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | public linkedList.Object getValue() { | ||
77 | return value; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | public NotificationChain basicSetValue(linkedList.Object newValue, NotificationChain msgs) { | ||
86 | linkedList.Object oldValue = value; | ||
87 | value = newValue; | ||
88 | if (eNotificationRequired()) { | ||
89 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, oldValue, newValue); | ||
90 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
91 | } | ||
92 | return msgs; | ||
93 | } | ||
94 | |||
95 | /** | ||
96 | * <!-- begin-user-doc --> | ||
97 | * <!-- end-user-doc --> | ||
98 | * @generated | ||
99 | */ | ||
100 | public void setValue(linkedList.Object newValue) { | ||
101 | if (newValue != value) { | ||
102 | NotificationChain msgs = null; | ||
103 | if (value != null) | ||
104 | msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); | ||
105 | if (newValue != null) | ||
106 | msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__VALUE, null, msgs); | ||
107 | msgs = basicSetValue(newValue, msgs); | ||
108 | if (msgs != null) msgs.dispatch(); | ||
109 | } | ||
110 | else if (eNotificationRequired()) | ||
111 | eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__VALUE, newValue, newValue)); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * <!-- begin-user-doc --> | ||
116 | * <!-- end-user-doc --> | ||
117 | * @generated | ||
118 | */ | ||
119 | public Element getNext() { | ||
120 | return next; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | public NotificationChain basicSetNext(Element newNext, NotificationChain msgs) { | ||
129 | Element oldNext = next; | ||
130 | next = newNext; | ||
131 | if (eNotificationRequired()) { | ||
132 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, oldNext, newNext); | ||
133 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
134 | } | ||
135 | return msgs; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * <!-- begin-user-doc --> | ||
140 | * <!-- end-user-doc --> | ||
141 | * @generated | ||
142 | */ | ||
143 | public void setNext(Element newNext) { | ||
144 | if (newNext != next) { | ||
145 | NotificationChain msgs = null; | ||
146 | if (next != null) | ||
147 | msgs = ((InternalEObject)next).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); | ||
148 | if (newNext != null) | ||
149 | msgs = ((InternalEObject)newNext).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - LinkedListPackage.ELEMENT__NEXT, null, msgs); | ||
150 | msgs = basicSetNext(newNext, msgs); | ||
151 | if (msgs != null) msgs.dispatch(); | ||
152 | } | ||
153 | else if (eNotificationRequired()) | ||
154 | eNotify(new ENotificationImpl(this, Notification.SET, LinkedListPackage.ELEMENT__NEXT, newNext, newNext)); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @Override | ||
163 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
164 | switch (featureID) { | ||
165 | case LinkedListPackage.ELEMENT__VALUE: | ||
166 | return basicSetValue(null, msgs); | ||
167 | case LinkedListPackage.ELEMENT__NEXT: | ||
168 | return basicSetNext(null, msgs); | ||
169 | } | ||
170 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
171 | } | ||
172 | |||
173 | /** | ||
174 | * <!-- begin-user-doc --> | ||
175 | * <!-- end-user-doc --> | ||
176 | * @generated | ||
177 | */ | ||
178 | @Override | ||
179 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
180 | switch (featureID) { | ||
181 | case LinkedListPackage.ELEMENT__VALUE: | ||
182 | return getValue(); | ||
183 | case LinkedListPackage.ELEMENT__NEXT: | ||
184 | return getNext(); | ||
185 | } | ||
186 | return super.eGet(featureID, resolve, coreType); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public void eSet(int featureID, Object newValue) { | ||
196 | switch (featureID) { | ||
197 | case LinkedListPackage.ELEMENT__VALUE: | ||
198 | setValue((linkedList.Object)newValue); | ||
199 | return; | ||
200 | case LinkedListPackage.ELEMENT__NEXT: | ||
201 | setNext((Element)newValue); | ||
202 | return; | ||
203 | } | ||
204 | super.eSet(featureID, newValue); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | */ | ||
212 | @Override | ||
213 | public void eUnset(int featureID) { | ||
214 | switch (featureID) { | ||
215 | case LinkedListPackage.ELEMENT__VALUE: | ||
216 | setValue((linkedList.Object)null); | ||
217 | return; | ||
218 | case LinkedListPackage.ELEMENT__NEXT: | ||
219 | setNext((Element)null); | ||
220 | return; | ||
221 | } | ||
222 | super.eUnset(featureID); | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @generated | ||
229 | */ | ||
230 | @Override | ||
231 | public boolean eIsSet(int featureID) { | ||
232 | switch (featureID) { | ||
233 | case LinkedListPackage.ELEMENT__VALUE: | ||
234 | return value != null; | ||
235 | case LinkedListPackage.ELEMENT__NEXT: | ||
236 | return next != null; | ||
237 | } | ||
238 | return super.eIsSet(featureID); | ||
239 | } | ||
240 | |||
241 | } //ElementImpl | ||