1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.usagemodel.impl; |
7 | |
8 | import java.util.Collection; |
9 | import java.util.Map; |
10 | |
11 | import org.eclipse.emf.common.notify.Notification; |
12 | import org.eclipse.emf.common.notify.NotificationChain; |
13 | import org.eclipse.emf.common.util.BasicDiagnostic; |
14 | import org.eclipse.emf.common.util.Diagnostic; |
15 | import org.eclipse.emf.common.util.DiagnosticChain; |
16 | import org.eclipse.emf.common.util.EList; |
17 | import org.eclipse.emf.ecore.EClass; |
18 | import org.eclipse.emf.ecore.InternalEObject; |
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
20 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
21 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; |
22 | import org.eclipse.emf.ecore.util.EObjectValidator; |
23 | import org.eclipse.emf.ecore.util.EcoreUtil; |
24 | import org.eclipse.emf.ecore.util.InternalEList; |
25 | import org.eclipse.ocl.ParserException; |
26 | import org.eclipse.ocl.ecore.Constraint; |
27 | import org.eclipse.ocl.ecore.OCL; |
28 | |
29 | import de.uka.ipd.sdq.pcm.core.entity.impl.EntityImpl; |
30 | import de.uka.ipd.sdq.pcm.usagemodel.AbstractUserAction; |
31 | import de.uka.ipd.sdq.pcm.usagemodel.BranchTransition; |
32 | import de.uka.ipd.sdq.pcm.usagemodel.Loop; |
33 | import de.uka.ipd.sdq.pcm.usagemodel.ScenarioBehaviour; |
34 | import de.uka.ipd.sdq.pcm.usagemodel.UsageScenario; |
35 | import de.uka.ipd.sdq.pcm.usagemodel.UsagemodelPackage; |
36 | import de.uka.ipd.sdq.pcm.usagemodel.util.UsagemodelValidator; |
37 | |
38 | /** |
39 | * <!-- begin-user-doc --> |
40 | * An implementation of the model object '<em><b>Scenario Behaviour</b></em>'. |
41 | * <!-- end-user-doc --> |
42 | * <p> |
43 | * The following features are implemented: |
44 | * <ul> |
45 | * <li>{@link de.uka.ipd.sdq.pcm.usagemodel.impl.ScenarioBehaviourImpl#getUsageScenario_SenarioBehaviour <em>Usage Scenario Senario Behaviour</em>}</li> |
46 | * <li>{@link de.uka.ipd.sdq.pcm.usagemodel.impl.ScenarioBehaviourImpl#getBranchTransition_ScenarioBehaviour <em>Branch Transition Scenario Behaviour</em>}</li> |
47 | * <li>{@link de.uka.ipd.sdq.pcm.usagemodel.impl.ScenarioBehaviourImpl#getLoop_ScenarioBehaviour <em>Loop Scenario Behaviour</em>}</li> |
48 | * <li>{@link de.uka.ipd.sdq.pcm.usagemodel.impl.ScenarioBehaviourImpl#getActions_ScenarioBehaviour <em>Actions Scenario Behaviour</em>}</li> |
49 | * </ul> |
50 | * </p> |
51 | * |
52 | * @generated |
53 | */ |
54 | public class ScenarioBehaviourImpl extends EntityImpl implements ScenarioBehaviour { |
55 | /** |
56 | * <!-- begin-user-doc --> |
57 | * <!-- end-user-doc --> |
58 | * @generated |
59 | */ |
60 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
61 | |
62 | /** |
63 | * The cached value of the '{@link #getActions_ScenarioBehaviour() <em>Actions Scenario Behaviour</em>}' containment reference list. |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @see #getActions_ScenarioBehaviour() |
67 | * @generated |
68 | * @ordered |
69 | */ |
70 | protected EList<AbstractUserAction> actions_ScenarioBehaviour; |
71 | |
72 | /** |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | protected ScenarioBehaviourImpl() { |
78 | super(); |
79 | } |
80 | |
81 | /** |
82 | * <!-- begin-user-doc --> |
83 | * <!-- end-user-doc --> |
84 | * @generated |
85 | */ |
86 | @Override |
87 | protected EClass eStaticClass() { |
88 | return UsagemodelPackage.Literals.SCENARIO_BEHAVIOUR; |
89 | } |
90 | |
91 | /** |
92 | * <!-- begin-user-doc --> |
93 | * <!-- end-user-doc --> |
94 | * @generated |
95 | */ |
96 | public EList<AbstractUserAction> getActions_ScenarioBehaviour() { |
97 | if (actions_ScenarioBehaviour == null) { |
98 | actions_ScenarioBehaviour = new EObjectContainmentWithInverseEList<AbstractUserAction>(AbstractUserAction.class, this, UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR, UsagemodelPackage.ABSTRACT_USER_ACTION__SCENARIO_BEHAVIOUR_ABSTRACT_USER_ACTION); |
99 | } |
100 | return actions_ScenarioBehaviour; |
101 | } |
102 | |
103 | /** |
104 | * The cached OCL expression body for the '{@link #Exactlyonestart(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactlyonestart</em>}' operation. |
105 | * <!-- begin-user-doc --> |
106 | * <!-- end-user-doc --> |
107 | * @see #Exactlyonestart(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
108 | * @generated |
109 | * @ordered |
110 | */ |
111 | protected static final String EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.actions_ScenarioBehaviour->select(s|s.oclIsTypeOf(Start))->size() = 1"; |
112 | |
113 | /** |
114 | * The cached OCL invariant for the '{@link #Exactlyonestart(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactlyonestart</em>}' invariant operation. |
115 | * <!-- begin-user-doc --> |
116 | * <!-- end-user-doc --> |
117 | * @see #Exactlyonestart(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
118 | * @generated |
119 | * @ordered |
120 | */ |
121 | protected static Constraint EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
122 | |
123 | /** |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated |
127 | */ |
128 | public boolean Exactlyonestart(DiagnosticChain diagnostics, Map<Object, Object> context) { |
129 | if (EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
130 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
131 | helper.setContext(UsagemodelPackage.Literals.SCENARIO_BEHAVIOUR); |
132 | try { |
133 | EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
134 | } |
135 | catch (ParserException pe) { |
136 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
137 | } |
138 | } |
139 | if (!EOCL_ENV.createQuery(EXACTLYONESTART__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
140 | if (diagnostics != null) { |
141 | diagnostics.add |
142 | (new BasicDiagnostic |
143 | (Diagnostic.ERROR, |
144 | UsagemodelValidator.DIAGNOSTIC_SOURCE, |
145 | UsagemodelValidator.SCENARIO_BEHAVIOUR__EXACTLYONESTART, |
146 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "Exactlyonestart", EObjectValidator.getObjectLabel(this, context) }), |
147 | new Object [] { this })); |
148 | } |
149 | return false; |
150 | } |
151 | return true; |
152 | } |
153 | |
154 | /** |
155 | * The cached OCL expression body for the '{@link #Exactlyonestop(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactlyonestop</em>}' operation. |
156 | * <!-- begin-user-doc --> |
157 | * <!-- end-user-doc --> |
158 | * @see #Exactlyonestop(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
159 | * @generated |
160 | * @ordered |
161 | */ |
162 | protected static final String EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.actions_ScenarioBehaviour->select(s|s.oclIsTypeOf(Stop))->size() = 1"; |
163 | |
164 | /** |
165 | * The cached OCL invariant for the '{@link #Exactlyonestop(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Exactlyonestop</em>}' invariant operation. |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @see #Exactlyonestop(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
169 | * @generated |
170 | * @ordered |
171 | */ |
172 | protected static Constraint EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
173 | |
174 | /** |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | public boolean Exactlyonestop(DiagnosticChain diagnostics, Map<Object, Object> context) { |
180 | if (EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
181 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
182 | helper.setContext(UsagemodelPackage.Literals.SCENARIO_BEHAVIOUR); |
183 | try { |
184 | EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
185 | } |
186 | catch (ParserException pe) { |
187 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
188 | } |
189 | } |
190 | if (!EOCL_ENV.createQuery(EXACTLYONESTOP__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
191 | if (diagnostics != null) { |
192 | diagnostics.add |
193 | (new BasicDiagnostic |
194 | (Diagnostic.ERROR, |
195 | UsagemodelValidator.DIAGNOSTIC_SOURCE, |
196 | UsagemodelValidator.SCENARIO_BEHAVIOUR__EXACTLYONESTOP, |
197 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "Exactlyonestop", EObjectValidator.getObjectLabel(this, context) }), |
198 | new Object [] { this })); |
199 | } |
200 | return false; |
201 | } |
202 | return true; |
203 | } |
204 | |
205 | /** |
206 | * The cached OCL expression body for the '{@link #EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Eachuseractionexcept Startand Stopmusthaveapredecessorandsuccessor</em>}' operation. |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @see #EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
210 | * @generated |
211 | * @ordered |
212 | */ |
213 | protected static final String EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "not self.actions_ScenarioBehaviour->select(s|not s.oclIsTypeOf(Start) and not s.oclIsTypeOf(Stop))->exists(a|a.oclAsType(AbstractUserAction).predecessor.oclIsUndefined()) and not self.actions_ScenarioBehaviour->select(s|not s.oclIsTypeOf(Start) and not s.oclIsTypeOf(Stop))->exists(a|a.oclAsType(AbstractUserAction).successor.oclIsUndefined())"; |
214 | |
215 | /** |
216 | * The cached OCL invariant for the '{@link #EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Eachuseractionexcept Startand Stopmusthaveapredecessorandsuccessor</em>}' invariant operation. |
217 | * <!-- begin-user-doc --> |
218 | * <!-- end-user-doc --> |
219 | * @see #EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
220 | * @generated |
221 | * @ordered |
222 | */ |
223 | protected static Constraint EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
224 | |
225 | /** |
226 | * <!-- begin-user-doc --> |
227 | * <!-- end-user-doc --> |
228 | * @generated |
229 | */ |
230 | public boolean EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor(DiagnosticChain diagnostics, Map<Object, Object> context) { |
231 | if (EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
232 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
233 | helper.setContext(UsagemodelPackage.Literals.SCENARIO_BEHAVIOUR); |
234 | try { |
235 | EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
236 | } |
237 | catch (ParserException pe) { |
238 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
239 | } |
240 | } |
241 | if (!EOCL_ENV.createQuery(EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
242 | if (diagnostics != null) { |
243 | diagnostics.add |
244 | (new BasicDiagnostic |
245 | (Diagnostic.ERROR, |
246 | UsagemodelValidator.DIAGNOSTIC_SOURCE, |
247 | UsagemodelValidator.SCENARIO_BEHAVIOUR__EACHUSERACTIONEXCEPT_STARTAND_STOPMUSTHAVEAPREDECESSORANDSUCCESSOR, |
248 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "EachuseractionexceptStartandStopmusthaveapredecessorandsuccessor", EObjectValidator.getObjectLabel(this, context) }), |
249 | new Object [] { this })); |
250 | } |
251 | return false; |
252 | } |
253 | return true; |
254 | } |
255 | |
256 | /** |
257 | * <!-- begin-user-doc --> |
258 | * <!-- end-user-doc --> |
259 | * @generated |
260 | */ |
261 | public BranchTransition getBranchTransition_ScenarioBehaviour() { |
262 | if (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR) return null; |
263 | return (BranchTransition)eContainer(); |
264 | } |
265 | |
266 | /** |
267 | * <!-- begin-user-doc --> |
268 | * <!-- end-user-doc --> |
269 | * @generated |
270 | */ |
271 | public NotificationChain basicSetBranchTransition_ScenarioBehaviour(BranchTransition newBranchTransition_ScenarioBehaviour, NotificationChain msgs) { |
272 | msgs = eBasicSetContainer((InternalEObject)newBranchTransition_ScenarioBehaviour, UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR, msgs); |
273 | return msgs; |
274 | } |
275 | |
276 | /** |
277 | * <!-- begin-user-doc --> |
278 | * <!-- end-user-doc --> |
279 | * @generated |
280 | */ |
281 | public void setBranchTransition_ScenarioBehaviour(BranchTransition newBranchTransition_ScenarioBehaviour) { |
282 | if (newBranchTransition_ScenarioBehaviour != eInternalContainer() || (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR && newBranchTransition_ScenarioBehaviour != null)) { |
283 | if (EcoreUtil.isAncestor(this, newBranchTransition_ScenarioBehaviour)) |
284 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
285 | NotificationChain msgs = null; |
286 | if (eInternalContainer() != null) |
287 | msgs = eBasicRemoveFromContainer(msgs); |
288 | if (newBranchTransition_ScenarioBehaviour != null) |
289 | msgs = ((InternalEObject)newBranchTransition_ScenarioBehaviour).eInverseAdd(this, UsagemodelPackage.BRANCH_TRANSITION__BRANCHED_BEHAVIOUR_BRANCH_TRANSITION, BranchTransition.class, msgs); |
290 | msgs = basicSetBranchTransition_ScenarioBehaviour(newBranchTransition_ScenarioBehaviour, msgs); |
291 | if (msgs != null) msgs.dispatch(); |
292 | } |
293 | else if (eNotificationRequired()) |
294 | eNotify(new ENotificationImpl(this, Notification.SET, UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR, newBranchTransition_ScenarioBehaviour, newBranchTransition_ScenarioBehaviour)); |
295 | } |
296 | |
297 | /** |
298 | * <!-- begin-user-doc --> |
299 | * <!-- end-user-doc --> |
300 | * @generated |
301 | */ |
302 | public Loop getLoop_ScenarioBehaviour() { |
303 | if (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR) return null; |
304 | return (Loop)eContainer(); |
305 | } |
306 | |
307 | /** |
308 | * <!-- begin-user-doc --> |
309 | * <!-- end-user-doc --> |
310 | * @generated |
311 | */ |
312 | public NotificationChain basicSetLoop_ScenarioBehaviour(Loop newLoop_ScenarioBehaviour, NotificationChain msgs) { |
313 | msgs = eBasicSetContainer((InternalEObject)newLoop_ScenarioBehaviour, UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR, msgs); |
314 | return msgs; |
315 | } |
316 | |
317 | /** |
318 | * <!-- begin-user-doc --> |
319 | * <!-- end-user-doc --> |
320 | * @generated |
321 | */ |
322 | public void setLoop_ScenarioBehaviour(Loop newLoop_ScenarioBehaviour) { |
323 | if (newLoop_ScenarioBehaviour != eInternalContainer() || (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR && newLoop_ScenarioBehaviour != null)) { |
324 | if (EcoreUtil.isAncestor(this, newLoop_ScenarioBehaviour)) |
325 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
326 | NotificationChain msgs = null; |
327 | if (eInternalContainer() != null) |
328 | msgs = eBasicRemoveFromContainer(msgs); |
329 | if (newLoop_ScenarioBehaviour != null) |
330 | msgs = ((InternalEObject)newLoop_ScenarioBehaviour).eInverseAdd(this, UsagemodelPackage.LOOP__BODY_BEHAVIOUR_LOOP, Loop.class, msgs); |
331 | msgs = basicSetLoop_ScenarioBehaviour(newLoop_ScenarioBehaviour, msgs); |
332 | if (msgs != null) msgs.dispatch(); |
333 | } |
334 | else if (eNotificationRequired()) |
335 | eNotify(new ENotificationImpl(this, Notification.SET, UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR, newLoop_ScenarioBehaviour, newLoop_ScenarioBehaviour)); |
336 | } |
337 | |
338 | /** |
339 | * <!-- begin-user-doc --> |
340 | * <!-- end-user-doc --> |
341 | * @generated |
342 | */ |
343 | public UsageScenario getUsageScenario_SenarioBehaviour() { |
344 | if (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR) return null; |
345 | return (UsageScenario)eContainer(); |
346 | } |
347 | |
348 | /** |
349 | * <!-- begin-user-doc --> |
350 | * <!-- end-user-doc --> |
351 | * @generated |
352 | */ |
353 | public NotificationChain basicSetUsageScenario_SenarioBehaviour(UsageScenario newUsageScenario_SenarioBehaviour, NotificationChain msgs) { |
354 | msgs = eBasicSetContainer((InternalEObject)newUsageScenario_SenarioBehaviour, UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR, msgs); |
355 | return msgs; |
356 | } |
357 | |
358 | /** |
359 | * <!-- begin-user-doc --> |
360 | * <!-- end-user-doc --> |
361 | * @generated |
362 | */ |
363 | public void setUsageScenario_SenarioBehaviour(UsageScenario newUsageScenario_SenarioBehaviour) { |
364 | if (newUsageScenario_SenarioBehaviour != eInternalContainer() || (eContainerFeatureID() != UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR && newUsageScenario_SenarioBehaviour != null)) { |
365 | if (EcoreUtil.isAncestor(this, newUsageScenario_SenarioBehaviour)) |
366 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
367 | NotificationChain msgs = null; |
368 | if (eInternalContainer() != null) |
369 | msgs = eBasicRemoveFromContainer(msgs); |
370 | if (newUsageScenario_SenarioBehaviour != null) |
371 | msgs = ((InternalEObject)newUsageScenario_SenarioBehaviour).eInverseAdd(this, UsagemodelPackage.USAGE_SCENARIO__SCENARIO_BEHAVIOUR_USAGE_SCENARIO, UsageScenario.class, msgs); |
372 | msgs = basicSetUsageScenario_SenarioBehaviour(newUsageScenario_SenarioBehaviour, msgs); |
373 | if (msgs != null) msgs.dispatch(); |
374 | } |
375 | else if (eNotificationRequired()) |
376 | eNotify(new ENotificationImpl(this, Notification.SET, UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR, newUsageScenario_SenarioBehaviour, newUsageScenario_SenarioBehaviour)); |
377 | } |
378 | |
379 | /** |
380 | * <!-- begin-user-doc --> |
381 | * <!-- end-user-doc --> |
382 | * @generated |
383 | */ |
384 | @SuppressWarnings("unchecked") |
385 | @Override |
386 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
387 | switch (featureID) { |
388 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
389 | if (eInternalContainer() != null) |
390 | msgs = eBasicRemoveFromContainer(msgs); |
391 | return basicSetUsageScenario_SenarioBehaviour((UsageScenario)otherEnd, msgs); |
392 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
393 | if (eInternalContainer() != null) |
394 | msgs = eBasicRemoveFromContainer(msgs); |
395 | return basicSetBranchTransition_ScenarioBehaviour((BranchTransition)otherEnd, msgs); |
396 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
397 | if (eInternalContainer() != null) |
398 | msgs = eBasicRemoveFromContainer(msgs); |
399 | return basicSetLoop_ScenarioBehaviour((Loop)otherEnd, msgs); |
400 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
401 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getActions_ScenarioBehaviour()).basicAdd(otherEnd, msgs); |
402 | } |
403 | return super.eInverseAdd(otherEnd, featureID, msgs); |
404 | } |
405 | |
406 | /** |
407 | * <!-- begin-user-doc --> |
408 | * <!-- end-user-doc --> |
409 | * @generated |
410 | */ |
411 | @Override |
412 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
413 | switch (featureID) { |
414 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
415 | return basicSetUsageScenario_SenarioBehaviour(null, msgs); |
416 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
417 | return basicSetBranchTransition_ScenarioBehaviour(null, msgs); |
418 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
419 | return basicSetLoop_ScenarioBehaviour(null, msgs); |
420 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
421 | return ((InternalEList<?>)getActions_ScenarioBehaviour()).basicRemove(otherEnd, msgs); |
422 | } |
423 | return super.eInverseRemove(otherEnd, featureID, msgs); |
424 | } |
425 | |
426 | /** |
427 | * <!-- begin-user-doc --> |
428 | * <!-- end-user-doc --> |
429 | * @generated |
430 | */ |
431 | @Override |
432 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
433 | switch (eContainerFeatureID()) { |
434 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
435 | return eInternalContainer().eInverseRemove(this, UsagemodelPackage.USAGE_SCENARIO__SCENARIO_BEHAVIOUR_USAGE_SCENARIO, UsageScenario.class, msgs); |
436 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
437 | return eInternalContainer().eInverseRemove(this, UsagemodelPackage.BRANCH_TRANSITION__BRANCHED_BEHAVIOUR_BRANCH_TRANSITION, BranchTransition.class, msgs); |
438 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
439 | return eInternalContainer().eInverseRemove(this, UsagemodelPackage.LOOP__BODY_BEHAVIOUR_LOOP, Loop.class, msgs); |
440 | } |
441 | return super.eBasicRemoveFromContainerFeature(msgs); |
442 | } |
443 | |
444 | /** |
445 | * <!-- begin-user-doc --> |
446 | * <!-- end-user-doc --> |
447 | * @generated |
448 | */ |
449 | @Override |
450 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
451 | switch (featureID) { |
452 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
453 | return getUsageScenario_SenarioBehaviour(); |
454 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
455 | return getBranchTransition_ScenarioBehaviour(); |
456 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
457 | return getLoop_ScenarioBehaviour(); |
458 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
459 | return getActions_ScenarioBehaviour(); |
460 | } |
461 | return super.eGet(featureID, resolve, coreType); |
462 | } |
463 | |
464 | /** |
465 | * <!-- begin-user-doc --> |
466 | * <!-- end-user-doc --> |
467 | * @generated |
468 | */ |
469 | @SuppressWarnings("unchecked") |
470 | @Override |
471 | public void eSet(int featureID, Object newValue) { |
472 | switch (featureID) { |
473 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
474 | setUsageScenario_SenarioBehaviour((UsageScenario)newValue); |
475 | return; |
476 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
477 | setBranchTransition_ScenarioBehaviour((BranchTransition)newValue); |
478 | return; |
479 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
480 | setLoop_ScenarioBehaviour((Loop)newValue); |
481 | return; |
482 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
483 | getActions_ScenarioBehaviour().clear(); |
484 | getActions_ScenarioBehaviour().addAll((Collection<? extends AbstractUserAction>)newValue); |
485 | return; |
486 | } |
487 | super.eSet(featureID, newValue); |
488 | } |
489 | |
490 | /** |
491 | * <!-- begin-user-doc --> |
492 | * <!-- end-user-doc --> |
493 | * @generated |
494 | */ |
495 | @Override |
496 | public void eUnset(int featureID) { |
497 | switch (featureID) { |
498 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
499 | setUsageScenario_SenarioBehaviour((UsageScenario)null); |
500 | return; |
501 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
502 | setBranchTransition_ScenarioBehaviour((BranchTransition)null); |
503 | return; |
504 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
505 | setLoop_ScenarioBehaviour((Loop)null); |
506 | return; |
507 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
508 | getActions_ScenarioBehaviour().clear(); |
509 | return; |
510 | } |
511 | super.eUnset(featureID); |
512 | } |
513 | |
514 | /** |
515 | * <!-- begin-user-doc --> |
516 | * <!-- end-user-doc --> |
517 | * @generated |
518 | */ |
519 | @Override |
520 | public boolean eIsSet(int featureID) { |
521 | switch (featureID) { |
522 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__USAGE_SCENARIO_SENARIO_BEHAVIOUR: |
523 | return getUsageScenario_SenarioBehaviour() != null; |
524 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__BRANCH_TRANSITION_SCENARIO_BEHAVIOUR: |
525 | return getBranchTransition_ScenarioBehaviour() != null; |
526 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__LOOP_SCENARIO_BEHAVIOUR: |
527 | return getLoop_ScenarioBehaviour() != null; |
528 | case UsagemodelPackage.SCENARIO_BEHAVIOUR__ACTIONS_SCENARIO_BEHAVIOUR: |
529 | return actions_ScenarioBehaviour != null && !actions_ScenarioBehaviour.isEmpty(); |
530 | } |
531 | return super.eIsSet(featureID); |
532 | } |
533 | |
534 | /** |
535 | * The cached environment for evaluating OCL expressions. |
536 | * <!-- begin-user-doc --> |
537 | * <!-- end-user-doc --> |
538 | * @generated |
539 | * @ordered |
540 | */ |
541 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
542 | |
543 | } //ScenarioBehaviourImpl |