1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.allocation.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.InternalEList; |
24 | import org.eclipse.ocl.ParserException; |
25 | import org.eclipse.ocl.ecore.Constraint; |
26 | import org.eclipse.ocl.ecore.OCL; |
27 | |
28 | import de.uka.ipd.sdq.pcm.allocation.Allocation; |
29 | import de.uka.ipd.sdq.pcm.allocation.AllocationContext; |
30 | import de.uka.ipd.sdq.pcm.allocation.AllocationPackage; |
31 | import de.uka.ipd.sdq.pcm.allocation.util.AllocationValidator; |
32 | import de.uka.ipd.sdq.pcm.core.entity.impl.EntityImpl; |
33 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceEnvironment; |
34 | |
35 | /** |
36 | * <!-- begin-user-doc --> |
37 | * An implementation of the model object '<em><b>Allocation</b></em>'. |
38 | * <!-- end-user-doc --> |
39 | * <p> |
40 | * The following features are implemented: |
41 | * <ul> |
42 | * <li>{@link de.uka.ipd.sdq.pcm.allocation.impl.AllocationImpl#getTargetResourceEnvironment_Allocation <em>Target Resource Environment Allocation</em>}</li> |
43 | * <li>{@link de.uka.ipd.sdq.pcm.allocation.impl.AllocationImpl#getSystem_Allocation <em>System Allocation</em>}</li> |
44 | * <li>{@link de.uka.ipd.sdq.pcm.allocation.impl.AllocationImpl#getAllocationContexts_Allocation <em>Allocation Contexts Allocation</em>}</li> |
45 | * </ul> |
46 | * </p> |
47 | * |
48 | * @generated |
49 | */ |
50 | public class AllocationImpl extends EntityImpl implements Allocation { |
51 | /** |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
57 | |
58 | /** |
59 | * The cached value of the '{@link #getTargetResourceEnvironment_Allocation() <em>Target Resource Environment Allocation</em>}' reference. |
60 | * <!-- begin-user-doc --> |
61 | * <!-- end-user-doc --> |
62 | * @see #getTargetResourceEnvironment_Allocation() |
63 | * @generated |
64 | * @ordered |
65 | */ |
66 | protected ResourceEnvironment targetResourceEnvironment_Allocation; |
67 | |
68 | /** |
69 | * The cached value of the '{@link #getSystem_Allocation() <em>System Allocation</em>}' reference. |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @see #getSystem_Allocation() |
73 | * @generated |
74 | * @ordered |
75 | */ |
76 | protected de.uka.ipd.sdq.pcm.system.System system_Allocation; |
77 | |
78 | /** |
79 | * The cached value of the '{@link #getAllocationContexts_Allocation() <em>Allocation Contexts Allocation</em>}' containment reference list. |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @see #getAllocationContexts_Allocation() |
83 | * @generated |
84 | * @ordered |
85 | */ |
86 | protected EList<AllocationContext> allocationContexts_Allocation; |
87 | |
88 | /** |
89 | * <!-- begin-user-doc --> |
90 | * <!-- end-user-doc --> |
91 | * @generated |
92 | */ |
93 | protected AllocationImpl() { |
94 | super(); |
95 | } |
96 | |
97 | /** |
98 | * <!-- begin-user-doc --> |
99 | * <!-- end-user-doc --> |
100 | * @generated |
101 | */ |
102 | @Override |
103 | protected EClass eStaticClass() { |
104 | return AllocationPackage.Literals.ALLOCATION; |
105 | } |
106 | |
107 | /** |
108 | * <!-- begin-user-doc --> |
109 | * <!-- end-user-doc --> |
110 | * @generated |
111 | */ |
112 | public ResourceEnvironment getTargetResourceEnvironment_Allocation() { |
113 | if (targetResourceEnvironment_Allocation != null && targetResourceEnvironment_Allocation.eIsProxy()) { |
114 | InternalEObject oldTargetResourceEnvironment_Allocation = (InternalEObject)targetResourceEnvironment_Allocation; |
115 | targetResourceEnvironment_Allocation = (ResourceEnvironment)eResolveProxy(oldTargetResourceEnvironment_Allocation); |
116 | if (targetResourceEnvironment_Allocation != oldTargetResourceEnvironment_Allocation) { |
117 | if (eNotificationRequired()) |
118 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION, oldTargetResourceEnvironment_Allocation, targetResourceEnvironment_Allocation)); |
119 | } |
120 | } |
121 | return targetResourceEnvironment_Allocation; |
122 | } |
123 | |
124 | /** |
125 | * <!-- begin-user-doc --> |
126 | * <!-- end-user-doc --> |
127 | * @generated |
128 | */ |
129 | public ResourceEnvironment basicGetTargetResourceEnvironment_Allocation() { |
130 | return targetResourceEnvironment_Allocation; |
131 | } |
132 | |
133 | /** |
134 | * <!-- begin-user-doc --> |
135 | * <!-- end-user-doc --> |
136 | * @generated |
137 | */ |
138 | public void setTargetResourceEnvironment_Allocation(ResourceEnvironment newTargetResourceEnvironment_Allocation) { |
139 | ResourceEnvironment oldTargetResourceEnvironment_Allocation = targetResourceEnvironment_Allocation; |
140 | targetResourceEnvironment_Allocation = newTargetResourceEnvironment_Allocation; |
141 | if (eNotificationRequired()) |
142 | eNotify(new ENotificationImpl(this, Notification.SET, AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION, oldTargetResourceEnvironment_Allocation, targetResourceEnvironment_Allocation)); |
143 | } |
144 | |
145 | /** |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | public de.uka.ipd.sdq.pcm.system.System getSystem_Allocation() { |
151 | if (system_Allocation != null && system_Allocation.eIsProxy()) { |
152 | InternalEObject oldSystem_Allocation = (InternalEObject)system_Allocation; |
153 | system_Allocation = (de.uka.ipd.sdq.pcm.system.System)eResolveProxy(oldSystem_Allocation); |
154 | if (system_Allocation != oldSystem_Allocation) { |
155 | if (eNotificationRequired()) |
156 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION, oldSystem_Allocation, system_Allocation)); |
157 | } |
158 | } |
159 | return system_Allocation; |
160 | } |
161 | |
162 | /** |
163 | * <!-- begin-user-doc --> |
164 | * <!-- end-user-doc --> |
165 | * @generated |
166 | */ |
167 | public de.uka.ipd.sdq.pcm.system.System basicGetSystem_Allocation() { |
168 | return system_Allocation; |
169 | } |
170 | |
171 | /** |
172 | * <!-- begin-user-doc --> |
173 | * <!-- end-user-doc --> |
174 | * @generated |
175 | */ |
176 | public void setSystem_Allocation(de.uka.ipd.sdq.pcm.system.System newSystem_Allocation) { |
177 | de.uka.ipd.sdq.pcm.system.System oldSystem_Allocation = system_Allocation; |
178 | system_Allocation = newSystem_Allocation; |
179 | if (eNotificationRequired()) |
180 | eNotify(new ENotificationImpl(this, Notification.SET, AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION, oldSystem_Allocation, system_Allocation)); |
181 | } |
182 | |
183 | /** |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | public EList<AllocationContext> getAllocationContexts_Allocation() { |
189 | if (allocationContexts_Allocation == null) { |
190 | allocationContexts_Allocation = new EObjectContainmentWithInverseEList<AllocationContext>(AllocationContext.class, this, AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION, AllocationPackage.ALLOCATION_CONTEXT__ALLOCATION_ALLOCATION_CONTEXT); |
191 | } |
192 | return allocationContexts_Allocation; |
193 | } |
194 | |
195 | /** |
196 | * The cached OCL expression body for the '{@link #EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Assembly Context Within System Has To Be Allocated Exactly Once</em>}' operation. |
197 | * <!-- begin-user-doc --> |
198 | * <!-- end-user-doc --> |
199 | * @see #EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
200 | * @generated |
201 | * @ordered |
202 | */ |
203 | protected static final String EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "-- Get all AssemblyContexts used by this system, that is \n"+"-- 1) the AssemblyContexts directly used in the system and \n"+"self.system_Allocation.assemblyContexts__ComposedStructure\n"+"-- 2) the AssemblyContexts used by SubSystems in the System. Note that if a SubSystem also contains other Subsystems,\n"+"-- we need to get those AssemblyContexts too: Thus, we use a closure here\n"+"->union(self.system_Allocation.assemblyContexts__ComposedStructure->closure(\n"+"encapsulatedComponent__AssemblyContext->select(composites|composites.oclIsTypeOf(pcm::subsystem::SubSystem)).oclAsType(pcm::subsystem::SubSystem)\n"+".assemblyContexts__ComposedStructure))\n"+"--Now, after we collected all AssemblyContexts somehow used, we check whether they need to be allocated \n"+"--and if yes, if they are allocated.\n"+"->forAll(assemblyCtx|\n"+"--AssemblyContexts that contain SubSystems do not need to be allocated\n"+"assemblyCtx.encapsulatedComponent__AssemblyContext.oclIsTypeOf(pcm::subsystem::SubSystem) or\n"+"--All others need to be allocated. \n"+"self.allocationContexts_Allocation->select(allocationCtx|\n"+"allocationCtx.assemblyContext_AllocationContext = assemblyCtx)->size() = 1)"; |
204 | |
205 | /** |
206 | * The cached OCL invariant for the '{@link #EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Each Assembly Context Within System Has To Be Allocated Exactly Once</em>}' invariant operation. |
207 | * <!-- begin-user-doc --> |
208 | * <!-- end-user-doc --> |
209 | * @see #EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
210 | * @generated |
211 | * @ordered |
212 | */ |
213 | protected static Constraint EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
214 | |
215 | /** |
216 | * <!-- begin-user-doc --> |
217 | * <!-- end-user-doc --> |
218 | * @generated |
219 | */ |
220 | public boolean EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce(DiagnosticChain diagnostics, Map<Object, Object> context) { |
221 | if (EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
222 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
223 | helper.setContext(AllocationPackage.Literals.ALLOCATION); |
224 | try { |
225 | EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
226 | } |
227 | catch (ParserException pe) { |
228 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
229 | } |
230 | } |
231 | if (!EOCL_ENV.createQuery(EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
232 | if (diagnostics != null) { |
233 | diagnostics.add |
234 | (new BasicDiagnostic |
235 | (Diagnostic.ERROR, |
236 | AllocationValidator.DIAGNOSTIC_SOURCE, |
237 | AllocationValidator.ALLOCATION__EACH_ASSEMBLY_CONTEXT_WITHIN_SYSTEM_HAS_TO_BE_ALLOCATED_EXACTLY_ONCE, |
238 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "EachAssemblyContextWithinSystemHasToBeAllocatedExactlyOnce", EObjectValidator.getObjectLabel(this, context) }), |
239 | new Object [] { this })); |
240 | } |
241 | return false; |
242 | } |
243 | return true; |
244 | } |
245 | |
246 | /** |
247 | * The cached OCL expression body for the '{@link #CommunicatingServersHaveToBeConnectedByLinkingResource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Communicating Servers Have To Be Connected By Linking Resource</em>}' operation. |
248 | * <!-- begin-user-doc --> |
249 | * <!-- end-user-doc --> |
250 | * @see #CommunicatingServersHaveToBeConnectedByLinkingResource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
251 | * @generated |
252 | * @ordered |
253 | */ |
254 | protected static final String COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "self.allocationContexts_Allocation->forAll(a | self.allocationContexts_Allocation->forAll(b | \n"+" --- if a and b are not on the same server\n"+" (a.resourceContainer_AllocationContext <> b.resourceContainer_AllocationContext \n"+" and\n"+" -- and if the assembly contexts of a and b are connected\n"+" self.system_Allocation.connectors__ComposedStructure->select(conn | conn.oclIsTypeOf(pcm::core::composition::AssemblyConnector)).oclAsType(pcm::core::composition::AssemblyConnector)->exists(conn | \n"+" (conn.providingAssemblyContext_AssemblyConnector = a.assemblyContext_AllocationContext \n"+" and \n"+" conn.requiringAssemblyContext_AssemblyConnector = b.assemblyContext_AllocationContext )\n"+" or \n"+" (conn.providingAssemblyContext_AssemblyConnector = b.assemblyContext_AllocationContext \n"+" and \n"+" conn.requiringAssemblyContext_AssemblyConnector = a.assemblyContext_AllocationContext )\n"+" )\n"+" )\n"+" -- then the servers have to be connected by a linking resource\n"+" implies \n"+" self.targetResourceEnvironment_Allocation.linkingResources__ResourceEnvironment->exists(l | \n"+" -- l connects the two\n"+" l.connectedResourceContainers_LinkingResource->includes(a.resourceContainer_AllocationContext)\n"+" and \n"+" l.connectedResourceContainers_LinkingResource->includes(b.resourceContainer_AllocationContext)\n"+" )\n"+" ))"; |
255 | |
256 | /** |
257 | * The cached OCL invariant for the '{@link #CommunicatingServersHaveToBeConnectedByLinkingResource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) <em>Communicating Servers Have To Be Connected By Linking Resource</em>}' invariant operation. |
258 | * <!-- begin-user-doc --> |
259 | * <!-- end-user-doc --> |
260 | * @see #CommunicatingServersHaveToBeConnectedByLinkingResource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) |
261 | * @generated |
262 | * @ordered |
263 | */ |
264 | protected static Constraint COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV; |
265 | |
266 | /** |
267 | * <!-- begin-user-doc --> |
268 | * <!-- end-user-doc --> |
269 | * @generated |
270 | */ |
271 | public boolean CommunicatingServersHaveToBeConnectedByLinkingResource(DiagnosticChain diagnostics, Map<Object, Object> context) { |
272 | if (COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { |
273 | OCL.Helper helper = EOCL_ENV.createOCLHelper(); |
274 | helper.setContext(AllocationPackage.Literals.ALLOCATION); |
275 | try { |
276 | COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); |
277 | } |
278 | catch (ParserException pe) { |
279 | throw new UnsupportedOperationException(pe.getLocalizedMessage()); |
280 | } |
281 | } |
282 | if (!EOCL_ENV.createQuery(COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(this)) { |
283 | if (diagnostics != null) { |
284 | diagnostics.add |
285 | (new BasicDiagnostic |
286 | (Diagnostic.ERROR, |
287 | AllocationValidator.DIAGNOSTIC_SOURCE, |
288 | AllocationValidator.ALLOCATION__COMMUNICATING_SERVERS_HAVE_TO_BE_CONNECTED_BY_LINKING_RESOURCE, |
289 | EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "CommunicatingServersHaveToBeConnectedByLinkingResource", EObjectValidator.getObjectLabel(this, context) }), |
290 | new Object [] { this })); |
291 | } |
292 | return false; |
293 | } |
294 | return true; |
295 | } |
296 | |
297 | /** |
298 | * <!-- begin-user-doc --> |
299 | * <!-- end-user-doc --> |
300 | * @generated |
301 | */ |
302 | @SuppressWarnings("unchecked") |
303 | @Override |
304 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
305 | switch (featureID) { |
306 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
307 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getAllocationContexts_Allocation()).basicAdd(otherEnd, msgs); |
308 | } |
309 | return super.eInverseAdd(otherEnd, featureID, msgs); |
310 | } |
311 | |
312 | /** |
313 | * <!-- begin-user-doc --> |
314 | * <!-- end-user-doc --> |
315 | * @generated |
316 | */ |
317 | @Override |
318 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
319 | switch (featureID) { |
320 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
321 | return ((InternalEList<?>)getAllocationContexts_Allocation()).basicRemove(otherEnd, msgs); |
322 | } |
323 | return super.eInverseRemove(otherEnd, featureID, msgs); |
324 | } |
325 | |
326 | /** |
327 | * <!-- begin-user-doc --> |
328 | * <!-- end-user-doc --> |
329 | * @generated |
330 | */ |
331 | @Override |
332 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
333 | switch (featureID) { |
334 | case AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION: |
335 | if (resolve) return getTargetResourceEnvironment_Allocation(); |
336 | return basicGetTargetResourceEnvironment_Allocation(); |
337 | case AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION: |
338 | if (resolve) return getSystem_Allocation(); |
339 | return basicGetSystem_Allocation(); |
340 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
341 | return getAllocationContexts_Allocation(); |
342 | } |
343 | return super.eGet(featureID, resolve, coreType); |
344 | } |
345 | |
346 | /** |
347 | * <!-- begin-user-doc --> |
348 | * <!-- end-user-doc --> |
349 | * @generated |
350 | */ |
351 | @SuppressWarnings("unchecked") |
352 | @Override |
353 | public void eSet(int featureID, Object newValue) { |
354 | switch (featureID) { |
355 | case AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION: |
356 | setTargetResourceEnvironment_Allocation((ResourceEnvironment)newValue); |
357 | return; |
358 | case AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION: |
359 | setSystem_Allocation((de.uka.ipd.sdq.pcm.system.System)newValue); |
360 | return; |
361 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
362 | getAllocationContexts_Allocation().clear(); |
363 | getAllocationContexts_Allocation().addAll((Collection<? extends AllocationContext>)newValue); |
364 | return; |
365 | } |
366 | super.eSet(featureID, newValue); |
367 | } |
368 | |
369 | /** |
370 | * <!-- begin-user-doc --> |
371 | * <!-- end-user-doc --> |
372 | * @generated |
373 | */ |
374 | @Override |
375 | public void eUnset(int featureID) { |
376 | switch (featureID) { |
377 | case AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION: |
378 | setTargetResourceEnvironment_Allocation((ResourceEnvironment)null); |
379 | return; |
380 | case AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION: |
381 | setSystem_Allocation((de.uka.ipd.sdq.pcm.system.System)null); |
382 | return; |
383 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
384 | getAllocationContexts_Allocation().clear(); |
385 | return; |
386 | } |
387 | super.eUnset(featureID); |
388 | } |
389 | |
390 | /** |
391 | * <!-- begin-user-doc --> |
392 | * <!-- end-user-doc --> |
393 | * @generated |
394 | */ |
395 | @Override |
396 | public boolean eIsSet(int featureID) { |
397 | switch (featureID) { |
398 | case AllocationPackage.ALLOCATION__TARGET_RESOURCE_ENVIRONMENT_ALLOCATION: |
399 | return targetResourceEnvironment_Allocation != null; |
400 | case AllocationPackage.ALLOCATION__SYSTEM_ALLOCATION: |
401 | return system_Allocation != null; |
402 | case AllocationPackage.ALLOCATION__ALLOCATION_CONTEXTS_ALLOCATION: |
403 | return allocationContexts_Allocation != null && !allocationContexts_Allocation.isEmpty(); |
404 | } |
405 | return super.eIsSet(featureID); |
406 | } |
407 | |
408 | /** |
409 | * The cached environment for evaluating OCL expressions. |
410 | * <!-- begin-user-doc --> |
411 | * <!-- end-user-doc --> |
412 | * @generated |
413 | * @ordered |
414 | */ |
415 | protected static final OCL EOCL_ENV = OCL.newInstance(); |
416 | |
417 | } //AllocationImpl |