1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.fzi.se.quality.parameters.impl; |
8 | |
9 | import de.fzi.se.quality.parameters.CallInstance; |
10 | import de.fzi.se.quality.parameters.ComponentInstance; |
11 | import de.fzi.se.quality.parameters.ParameterInstance; |
12 | import de.fzi.se.quality.parameters.ParameterReference; |
13 | import de.fzi.se.quality.parameters.ParameterValue; |
14 | import de.fzi.se.quality.parameters.ParametersPackage; |
15 | |
16 | import org.eclipse.emf.common.notify.Notification; |
17 | import org.eclipse.emf.common.notify.NotificationChain; |
18 | |
19 | import org.eclipse.emf.ecore.EClass; |
20 | import org.eclipse.emf.ecore.InternalEObject; |
21 | |
22 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
23 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
24 | |
25 | import org.eclipse.emf.ecore.util.EcoreUtil; |
26 | |
27 | /** |
28 | * <!-- begin-user-doc --> |
29 | * An implementation of the model object '<em><b>Parameter Instance</b></em>'. |
30 | * <!-- end-user-doc --> |
31 | * <p> |
32 | * The following features are implemented: |
33 | * <ul> |
34 | * <li>{@link de.fzi.se.quality.parameters.impl.ParameterInstanceImpl#getParameterReference <em>Parameter Reference</em>}</li> |
35 | * <li>{@link de.fzi.se.quality.parameters.impl.ParameterInstanceImpl#getInputCallInstance <em>Input Call Instance</em>}</li> |
36 | * <li>{@link de.fzi.se.quality.parameters.impl.ParameterInstanceImpl#getOutputCallInstance <em>Output Call Instance</em>}</li> |
37 | * <li>{@link de.fzi.se.quality.parameters.impl.ParameterInstanceImpl#getComponentInstance <em>Component Instance</em>}</li> |
38 | * <li>{@link de.fzi.se.quality.parameters.impl.ParameterInstanceImpl#getParameterValue <em>Parameter Value</em>}</li> |
39 | * </ul> |
40 | * </p> |
41 | * |
42 | * @generated |
43 | */ |
44 | public class ParameterInstanceImpl extends EObjectImpl implements ParameterInstance { |
45 | /** |
46 | * The cached value of the '{@link #getParameterReference() <em>Parameter Reference</em>}' containment reference. |
47 | * <!-- begin-user-doc --> |
48 | * <!-- end-user-doc --> |
49 | * @see #getParameterReference() |
50 | * @generated |
51 | * @ordered |
52 | */ |
53 | protected ParameterReference parameterReference; |
54 | |
55 | /** |
56 | * The cached value of the '{@link #getParameterValue() <em>Parameter Value</em>}' containment reference. |
57 | * <!-- begin-user-doc --> |
58 | * <!-- end-user-doc --> |
59 | * @see #getParameterValue() |
60 | * @generated |
61 | * @ordered |
62 | */ |
63 | protected ParameterValue parameterValue; |
64 | |
65 | /** |
66 | * <!-- begin-user-doc --> |
67 | * <!-- end-user-doc --> |
68 | * @generated |
69 | */ |
70 | protected ParameterInstanceImpl() { |
71 | super(); |
72 | } |
73 | |
74 | /** |
75 | * <!-- begin-user-doc --> |
76 | * <!-- end-user-doc --> |
77 | * @generated |
78 | */ |
79 | @Override |
80 | protected EClass eStaticClass() { |
81 | return ParametersPackage.Literals.PARAMETER_INSTANCE; |
82 | } |
83 | |
84 | /** |
85 | * <!-- begin-user-doc --> |
86 | * <!-- end-user-doc --> |
87 | * @generated |
88 | */ |
89 | public ParameterReference getParameterReference() { |
90 | return parameterReference; |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | public NotificationChain basicSetParameterReference(ParameterReference newParameterReference, NotificationChain msgs) { |
99 | ParameterReference oldParameterReference = parameterReference; |
100 | parameterReference = newParameterReference; |
101 | if (eNotificationRequired()) { |
102 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE, oldParameterReference, newParameterReference); |
103 | if (msgs == null) msgs = notification; else msgs.add(notification); |
104 | } |
105 | return msgs; |
106 | } |
107 | |
108 | /** |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | public void setParameterReference(ParameterReference newParameterReference) { |
114 | if (newParameterReference != parameterReference) { |
115 | NotificationChain msgs = null; |
116 | if (parameterReference != null) |
117 | msgs = ((InternalEObject)parameterReference).eInverseRemove(this, ParametersPackage.PARAMETER_REFERENCE__PARAMETER_INSTANCE, ParameterReference.class, msgs); |
118 | if (newParameterReference != null) |
119 | msgs = ((InternalEObject)newParameterReference).eInverseAdd(this, ParametersPackage.PARAMETER_REFERENCE__PARAMETER_INSTANCE, ParameterReference.class, msgs); |
120 | msgs = basicSetParameterReference(newParameterReference, msgs); |
121 | if (msgs != null) msgs.dispatch(); |
122 | } |
123 | else if (eNotificationRequired()) |
124 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE, newParameterReference, newParameterReference)); |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | public CallInstance getInputCallInstance() { |
133 | if (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE) return null; |
134 | return (CallInstance)eContainer(); |
135 | } |
136 | |
137 | /** |
138 | * <!-- begin-user-doc --> |
139 | * <!-- end-user-doc --> |
140 | * @generated |
141 | */ |
142 | public NotificationChain basicSetInputCallInstance(CallInstance newInputCallInstance, NotificationChain msgs) { |
143 | msgs = eBasicSetContainer((InternalEObject)newInputCallInstance, ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE, msgs); |
144 | return msgs; |
145 | } |
146 | |
147 | /** |
148 | * <!-- begin-user-doc --> |
149 | * <!-- end-user-doc --> |
150 | * @generated |
151 | */ |
152 | public void setInputCallInstance(CallInstance newInputCallInstance) { |
153 | if (newInputCallInstance != eInternalContainer() || (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE && newInputCallInstance != null)) { |
154 | if (EcoreUtil.isAncestor(this, newInputCallInstance)) |
155 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
156 | NotificationChain msgs = null; |
157 | if (eInternalContainer() != null) |
158 | msgs = eBasicRemoveFromContainer(msgs); |
159 | if (newInputCallInstance != null) |
160 | msgs = ((InternalEObject)newInputCallInstance).eInverseAdd(this, ParametersPackage.CALL_INSTANCE__INPUT_PARAMETER_INSTANCES, CallInstance.class, msgs); |
161 | msgs = basicSetInputCallInstance(newInputCallInstance, msgs); |
162 | if (msgs != null) msgs.dispatch(); |
163 | } |
164 | else if (eNotificationRequired()) |
165 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE, newInputCallInstance, newInputCallInstance)); |
166 | } |
167 | |
168 | /** |
169 | * <!-- begin-user-doc --> |
170 | * <!-- end-user-doc --> |
171 | * @generated |
172 | */ |
173 | public CallInstance getOutputCallInstance() { |
174 | if (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE) return null; |
175 | return (CallInstance)eContainer(); |
176 | } |
177 | |
178 | /** |
179 | * <!-- begin-user-doc --> |
180 | * <!-- end-user-doc --> |
181 | * @generated |
182 | */ |
183 | public NotificationChain basicSetOutputCallInstance(CallInstance newOutputCallInstance, NotificationChain msgs) { |
184 | msgs = eBasicSetContainer((InternalEObject)newOutputCallInstance, ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE, msgs); |
185 | return msgs; |
186 | } |
187 | |
188 | /** |
189 | * <!-- begin-user-doc --> |
190 | * <!-- end-user-doc --> |
191 | * @generated |
192 | */ |
193 | public void setOutputCallInstance(CallInstance newOutputCallInstance) { |
194 | if (newOutputCallInstance != eInternalContainer() || (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE && newOutputCallInstance != null)) { |
195 | if (EcoreUtil.isAncestor(this, newOutputCallInstance)) |
196 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
197 | NotificationChain msgs = null; |
198 | if (eInternalContainer() != null) |
199 | msgs = eBasicRemoveFromContainer(msgs); |
200 | if (newOutputCallInstance != null) |
201 | msgs = ((InternalEObject)newOutputCallInstance).eInverseAdd(this, ParametersPackage.CALL_INSTANCE__OUTPUT_PARAMETER_INSTANCES, CallInstance.class, msgs); |
202 | msgs = basicSetOutputCallInstance(newOutputCallInstance, msgs); |
203 | if (msgs != null) msgs.dispatch(); |
204 | } |
205 | else if (eNotificationRequired()) |
206 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE, newOutputCallInstance, newOutputCallInstance)); |
207 | } |
208 | |
209 | /** |
210 | * <!-- begin-user-doc --> |
211 | * <!-- end-user-doc --> |
212 | * @generated |
213 | */ |
214 | public ComponentInstance getComponentInstance() { |
215 | if (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE) return null; |
216 | return (ComponentInstance)eContainer(); |
217 | } |
218 | |
219 | /** |
220 | * <!-- begin-user-doc --> |
221 | * <!-- end-user-doc --> |
222 | * @generated |
223 | */ |
224 | public NotificationChain basicSetComponentInstance(ComponentInstance newComponentInstance, NotificationChain msgs) { |
225 | msgs = eBasicSetContainer((InternalEObject)newComponentInstance, ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE, msgs); |
226 | return msgs; |
227 | } |
228 | |
229 | /** |
230 | * <!-- begin-user-doc --> |
231 | * <!-- end-user-doc --> |
232 | * @generated |
233 | */ |
234 | public void setComponentInstance(ComponentInstance newComponentInstance) { |
235 | if (newComponentInstance != eInternalContainer() || (eContainerFeatureID() != ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE && newComponentInstance != null)) { |
236 | if (EcoreUtil.isAncestor(this, newComponentInstance)) |
237 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
238 | NotificationChain msgs = null; |
239 | if (eInternalContainer() != null) |
240 | msgs = eBasicRemoveFromContainer(msgs); |
241 | if (newComponentInstance != null) |
242 | msgs = ((InternalEObject)newComponentInstance).eInverseAdd(this, ParametersPackage.COMPONENT_INSTANCE__PARAMETER_INSTANCES, ComponentInstance.class, msgs); |
243 | msgs = basicSetComponentInstance(newComponentInstance, msgs); |
244 | if (msgs != null) msgs.dispatch(); |
245 | } |
246 | else if (eNotificationRequired()) |
247 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE, newComponentInstance, newComponentInstance)); |
248 | } |
249 | |
250 | /** |
251 | * <!-- begin-user-doc --> |
252 | * <!-- end-user-doc --> |
253 | * @generated |
254 | */ |
255 | public ParameterValue getParameterValue() { |
256 | return parameterValue; |
257 | } |
258 | |
259 | /** |
260 | * <!-- begin-user-doc --> |
261 | * <!-- end-user-doc --> |
262 | * @generated |
263 | */ |
264 | public NotificationChain basicSetParameterValue(ParameterValue newParameterValue, NotificationChain msgs) { |
265 | ParameterValue oldParameterValue = parameterValue; |
266 | parameterValue = newParameterValue; |
267 | if (eNotificationRequired()) { |
268 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE, oldParameterValue, newParameterValue); |
269 | if (msgs == null) msgs = notification; else msgs.add(notification); |
270 | } |
271 | return msgs; |
272 | } |
273 | |
274 | /** |
275 | * <!-- begin-user-doc --> |
276 | * <!-- end-user-doc --> |
277 | * @generated |
278 | */ |
279 | public void setParameterValue(ParameterValue newParameterValue) { |
280 | if (newParameterValue != parameterValue) { |
281 | NotificationChain msgs = null; |
282 | if (parameterValue != null) |
283 | msgs = ((InternalEObject)parameterValue).eInverseRemove(this, ParametersPackage.PARAMETER_VALUE__PARAMETER_INSTANCE, ParameterValue.class, msgs); |
284 | if (newParameterValue != null) |
285 | msgs = ((InternalEObject)newParameterValue).eInverseAdd(this, ParametersPackage.PARAMETER_VALUE__PARAMETER_INSTANCE, ParameterValue.class, msgs); |
286 | msgs = basicSetParameterValue(newParameterValue, msgs); |
287 | if (msgs != null) msgs.dispatch(); |
288 | } |
289 | else if (eNotificationRequired()) |
290 | eNotify(new ENotificationImpl(this, Notification.SET, ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE, newParameterValue, newParameterValue)); |
291 | } |
292 | |
293 | /** |
294 | * <!-- begin-user-doc --> |
295 | * <!-- end-user-doc --> |
296 | * @generated |
297 | */ |
298 | @Override |
299 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
300 | switch (featureID) { |
301 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
302 | if (parameterReference != null) |
303 | msgs = ((InternalEObject)parameterReference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE, null, msgs); |
304 | return basicSetParameterReference((ParameterReference)otherEnd, msgs); |
305 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
306 | if (eInternalContainer() != null) |
307 | msgs = eBasicRemoveFromContainer(msgs); |
308 | return basicSetInputCallInstance((CallInstance)otherEnd, msgs); |
309 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
310 | if (eInternalContainer() != null) |
311 | msgs = eBasicRemoveFromContainer(msgs); |
312 | return basicSetOutputCallInstance((CallInstance)otherEnd, msgs); |
313 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
314 | if (eInternalContainer() != null) |
315 | msgs = eBasicRemoveFromContainer(msgs); |
316 | return basicSetComponentInstance((ComponentInstance)otherEnd, msgs); |
317 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
318 | if (parameterValue != null) |
319 | msgs = ((InternalEObject)parameterValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE, null, msgs); |
320 | return basicSetParameterValue((ParameterValue)otherEnd, msgs); |
321 | } |
322 | return super.eInverseAdd(otherEnd, featureID, msgs); |
323 | } |
324 | |
325 | /** |
326 | * <!-- begin-user-doc --> |
327 | * <!-- end-user-doc --> |
328 | * @generated |
329 | */ |
330 | @Override |
331 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
332 | switch (featureID) { |
333 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
334 | return basicSetParameterReference(null, msgs); |
335 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
336 | return basicSetInputCallInstance(null, msgs); |
337 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
338 | return basicSetOutputCallInstance(null, msgs); |
339 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
340 | return basicSetComponentInstance(null, msgs); |
341 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
342 | return basicSetParameterValue(null, msgs); |
343 | } |
344 | return super.eInverseRemove(otherEnd, featureID, msgs); |
345 | } |
346 | |
347 | /** |
348 | * <!-- begin-user-doc --> |
349 | * <!-- end-user-doc --> |
350 | * @generated |
351 | */ |
352 | @Override |
353 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
354 | switch (eContainerFeatureID()) { |
355 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
356 | return eInternalContainer().eInverseRemove(this, ParametersPackage.CALL_INSTANCE__INPUT_PARAMETER_INSTANCES, CallInstance.class, msgs); |
357 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
358 | return eInternalContainer().eInverseRemove(this, ParametersPackage.CALL_INSTANCE__OUTPUT_PARAMETER_INSTANCES, CallInstance.class, msgs); |
359 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
360 | return eInternalContainer().eInverseRemove(this, ParametersPackage.COMPONENT_INSTANCE__PARAMETER_INSTANCES, ComponentInstance.class, msgs); |
361 | } |
362 | return super.eBasicRemoveFromContainerFeature(msgs); |
363 | } |
364 | |
365 | /** |
366 | * <!-- begin-user-doc --> |
367 | * <!-- end-user-doc --> |
368 | * @generated |
369 | */ |
370 | @Override |
371 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
372 | switch (featureID) { |
373 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
374 | return getParameterReference(); |
375 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
376 | return getInputCallInstance(); |
377 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
378 | return getOutputCallInstance(); |
379 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
380 | return getComponentInstance(); |
381 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
382 | return getParameterValue(); |
383 | } |
384 | return super.eGet(featureID, resolve, coreType); |
385 | } |
386 | |
387 | /** |
388 | * <!-- begin-user-doc --> |
389 | * <!-- end-user-doc --> |
390 | * @generated |
391 | */ |
392 | @Override |
393 | public void eSet(int featureID, Object newValue) { |
394 | switch (featureID) { |
395 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
396 | setParameterReference((ParameterReference)newValue); |
397 | return; |
398 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
399 | setInputCallInstance((CallInstance)newValue); |
400 | return; |
401 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
402 | setOutputCallInstance((CallInstance)newValue); |
403 | return; |
404 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
405 | setComponentInstance((ComponentInstance)newValue); |
406 | return; |
407 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
408 | setParameterValue((ParameterValue)newValue); |
409 | return; |
410 | } |
411 | super.eSet(featureID, newValue); |
412 | } |
413 | |
414 | /** |
415 | * <!-- begin-user-doc --> |
416 | * <!-- end-user-doc --> |
417 | * @generated |
418 | */ |
419 | @Override |
420 | public void eUnset(int featureID) { |
421 | switch (featureID) { |
422 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
423 | setParameterReference((ParameterReference)null); |
424 | return; |
425 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
426 | setInputCallInstance((CallInstance)null); |
427 | return; |
428 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
429 | setOutputCallInstance((CallInstance)null); |
430 | return; |
431 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
432 | setComponentInstance((ComponentInstance)null); |
433 | return; |
434 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
435 | setParameterValue((ParameterValue)null); |
436 | return; |
437 | } |
438 | super.eUnset(featureID); |
439 | } |
440 | |
441 | /** |
442 | * <!-- begin-user-doc --> |
443 | * <!-- end-user-doc --> |
444 | * @generated |
445 | */ |
446 | @Override |
447 | public boolean eIsSet(int featureID) { |
448 | switch (featureID) { |
449 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_REFERENCE: |
450 | return parameterReference != null; |
451 | case ParametersPackage.PARAMETER_INSTANCE__INPUT_CALL_INSTANCE: |
452 | return getInputCallInstance() != null; |
453 | case ParametersPackage.PARAMETER_INSTANCE__OUTPUT_CALL_INSTANCE: |
454 | return getOutputCallInstance() != null; |
455 | case ParametersPackage.PARAMETER_INSTANCE__COMPONENT_INSTANCE: |
456 | return getComponentInstance() != null; |
457 | case ParametersPackage.PARAMETER_INSTANCE__PARAMETER_VALUE: |
458 | return parameterValue != null; |
459 | } |
460 | return super.eIsSet(featureID); |
461 | } |
462 | |
463 | } //ParameterInstanceImpl |