diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl')
10 files changed, 3414 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java new file mode 100644 index 00000000..cea2d6f4 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java | |||
@@ -0,0 +1,405 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.Notification; | ||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.ecore.EClass; | ||
15 | import org.eclipse.emf.ecore.InternalEObject; | ||
16 | |||
17 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
19 | |||
20 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
21 | |||
22 | /** | ||
23 | * <!-- begin-user-doc --> | ||
24 | * An implementation of the model object '<em><b>Application Instance</b></em>'. | ||
25 | * <!-- end-user-doc --> | ||
26 | * <p> | ||
27 | * The following features are implemented: | ||
28 | * </p> | ||
29 | * <ul> | ||
30 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getRequirement <em>Requirement</em>}</li> | ||
31 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getType <em>Type</em>}</li> | ||
32 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getAllocatedTo <em>Allocated To</em>}</li> | ||
33 | * </ul> | ||
34 | * | ||
35 | * @generated | ||
36 | */ | ||
37 | public class ApplicationInstanceImpl extends MinimalEObjectImpl.Container implements ApplicationInstance { | ||
38 | /** | ||
39 | * The cached value of the '{@link #getRequirement() <em>Requirement</em>}' reference. | ||
40 | * <!-- begin-user-doc --> | ||
41 | * <!-- end-user-doc --> | ||
42 | * @see #getRequirement() | ||
43 | * @generated | ||
44 | * @ordered | ||
45 | */ | ||
46 | protected Requirement requirement; | ||
47 | |||
48 | /** | ||
49 | * The cached value of the '{@link #getAllocatedTo() <em>Allocated To</em>}' reference. | ||
50 | * <!-- begin-user-doc --> | ||
51 | * <!-- end-user-doc --> | ||
52 | * @see #getAllocatedTo() | ||
53 | * @generated | ||
54 | * @ordered | ||
55 | */ | ||
56 | protected HostInstance allocatedTo; | ||
57 | |||
58 | /** | ||
59 | * <!-- begin-user-doc --> | ||
60 | * <!-- end-user-doc --> | ||
61 | * @generated | ||
62 | */ | ||
63 | protected ApplicationInstanceImpl() { | ||
64 | super(); | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * <!-- begin-user-doc --> | ||
69 | * <!-- end-user-doc --> | ||
70 | * @generated | ||
71 | */ | ||
72 | @Override | ||
73 | protected EClass eStaticClass() { | ||
74 | return CpsPackage.Literals.APPLICATION_INSTANCE; | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @generated | ||
81 | */ | ||
82 | @Override | ||
83 | public Requirement getRequirement() { | ||
84 | if (requirement != null && requirement.eIsProxy()) { | ||
85 | InternalEObject oldRequirement = (InternalEObject) requirement; | ||
86 | requirement = (Requirement) eResolveProxy(oldRequirement); | ||
87 | if (requirement != oldRequirement) { | ||
88 | if (eNotificationRequired()) | ||
89 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, | ||
90 | CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, requirement)); | ||
91 | } | ||
92 | } | ||
93 | return requirement; | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * <!-- begin-user-doc --> | ||
98 | * <!-- end-user-doc --> | ||
99 | * @generated | ||
100 | */ | ||
101 | public Requirement basicGetRequirement() { | ||
102 | return requirement; | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @generated | ||
109 | */ | ||
110 | public NotificationChain basicSetRequirement(Requirement newRequirement, NotificationChain msgs) { | ||
111 | Requirement oldRequirement = requirement; | ||
112 | requirement = newRequirement; | ||
113 | if (eNotificationRequired()) { | ||
114 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, | ||
115 | CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, newRequirement); | ||
116 | if (msgs == null) | ||
117 | msgs = notification; | ||
118 | else | ||
119 | msgs.add(notification); | ||
120 | } | ||
121 | return msgs; | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | */ | ||
129 | @Override | ||
130 | public void setRequirement(Requirement newRequirement) { | ||
131 | if (newRequirement != requirement) { | ||
132 | NotificationChain msgs = null; | ||
133 | if (requirement != null) | ||
134 | msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES, | ||
135 | Requirement.class, msgs); | ||
136 | if (newRequirement != null) | ||
137 | msgs = ((InternalEObject) newRequirement).eInverseAdd(this, CpsPackage.REQUIREMENT__INSTANCES, | ||
138 | Requirement.class, msgs); | ||
139 | msgs = basicSetRequirement(newRequirement, msgs); | ||
140 | if (msgs != null) | ||
141 | msgs.dispatch(); | ||
142 | } else if (eNotificationRequired()) | ||
143 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, | ||
144 | newRequirement, newRequirement)); | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * <!-- begin-user-doc --> | ||
149 | * <!-- end-user-doc --> | ||
150 | * @generated | ||
151 | */ | ||
152 | @Override | ||
153 | public ApplicationType getType() { | ||
154 | if (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE) | ||
155 | return null; | ||
156 | return (ApplicationType) eInternalContainer(); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | public NotificationChain basicSetType(ApplicationType newType, NotificationChain msgs) { | ||
165 | msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.APPLICATION_INSTANCE__TYPE, msgs); | ||
166 | return msgs; | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * <!-- begin-user-doc --> | ||
171 | * <!-- end-user-doc --> | ||
172 | * @generated | ||
173 | */ | ||
174 | @Override | ||
175 | public void setType(ApplicationType newType) { | ||
176 | if (newType != eInternalContainer() | ||
177 | || (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE && newType != null)) { | ||
178 | if (EcoreUtil.isAncestor(this, newType)) | ||
179 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
180 | NotificationChain msgs = null; | ||
181 | if (eInternalContainer() != null) | ||
182 | msgs = eBasicRemoveFromContainer(msgs); | ||
183 | if (newType != null) | ||
184 | msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.APPLICATION_TYPE__INSTANCES, | ||
185 | ApplicationType.class, msgs); | ||
186 | msgs = basicSetType(newType, msgs); | ||
187 | if (msgs != null) | ||
188 | msgs.dispatch(); | ||
189 | } else if (eNotificationRequired()) | ||
190 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__TYPE, newType, | ||
191 | newType)); | ||
192 | } | ||
193 | |||
194 | /** | ||
195 | * <!-- begin-user-doc --> | ||
196 | * <!-- end-user-doc --> | ||
197 | * @generated | ||
198 | */ | ||
199 | @Override | ||
200 | public HostInstance getAllocatedTo() { | ||
201 | if (allocatedTo != null && allocatedTo.eIsProxy()) { | ||
202 | InternalEObject oldAllocatedTo = (InternalEObject) allocatedTo; | ||
203 | allocatedTo = (HostInstance) eResolveProxy(oldAllocatedTo); | ||
204 | if (allocatedTo != oldAllocatedTo) { | ||
205 | if (eNotificationRequired()) | ||
206 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, | ||
207 | CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, allocatedTo)); | ||
208 | } | ||
209 | } | ||
210 | return allocatedTo; | ||
211 | } | ||
212 | |||
213 | /** | ||
214 | * <!-- begin-user-doc --> | ||
215 | * <!-- end-user-doc --> | ||
216 | * @generated | ||
217 | */ | ||
218 | public HostInstance basicGetAllocatedTo() { | ||
219 | return allocatedTo; | ||
220 | } | ||
221 | |||
222 | /** | ||
223 | * <!-- begin-user-doc --> | ||
224 | * <!-- end-user-doc --> | ||
225 | * @generated | ||
226 | */ | ||
227 | public NotificationChain basicSetAllocatedTo(HostInstance newAllocatedTo, NotificationChain msgs) { | ||
228 | HostInstance oldAllocatedTo = allocatedTo; | ||
229 | allocatedTo = newAllocatedTo; | ||
230 | if (eNotificationRequired()) { | ||
231 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, | ||
232 | CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, newAllocatedTo); | ||
233 | if (msgs == null) | ||
234 | msgs = notification; | ||
235 | else | ||
236 | msgs.add(notification); | ||
237 | } | ||
238 | return msgs; | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * <!-- begin-user-doc --> | ||
243 | * <!-- end-user-doc --> | ||
244 | * @generated | ||
245 | */ | ||
246 | @Override | ||
247 | public void setAllocatedTo(HostInstance newAllocatedTo) { | ||
248 | if (newAllocatedTo != allocatedTo) { | ||
249 | NotificationChain msgs = null; | ||
250 | if (allocatedTo != null) | ||
251 | msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, | ||
252 | HostInstance.class, msgs); | ||
253 | if (newAllocatedTo != null) | ||
254 | msgs = ((InternalEObject) newAllocatedTo).eInverseAdd(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, | ||
255 | HostInstance.class, msgs); | ||
256 | msgs = basicSetAllocatedTo(newAllocatedTo, msgs); | ||
257 | if (msgs != null) | ||
258 | msgs.dispatch(); | ||
259 | } else if (eNotificationRequired()) | ||
260 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, | ||
261 | newAllocatedTo, newAllocatedTo)); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <!-- begin-user-doc --> | ||
266 | * <!-- end-user-doc --> | ||
267 | * @generated | ||
268 | */ | ||
269 | @Override | ||
270 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
271 | switch (featureID) { | ||
272 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
273 | if (requirement != null) | ||
274 | msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES, | ||
275 | Requirement.class, msgs); | ||
276 | return basicSetRequirement((Requirement) otherEnd, msgs); | ||
277 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
278 | if (eInternalContainer() != null) | ||
279 | msgs = eBasicRemoveFromContainer(msgs); | ||
280 | return basicSetType((ApplicationType) otherEnd, msgs); | ||
281 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
282 | if (allocatedTo != null) | ||
283 | msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS, | ||
284 | HostInstance.class, msgs); | ||
285 | return basicSetAllocatedTo((HostInstance) otherEnd, msgs); | ||
286 | } | ||
287 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * <!-- begin-user-doc --> | ||
292 | * <!-- end-user-doc --> | ||
293 | * @generated | ||
294 | */ | ||
295 | @Override | ||
296 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
297 | switch (featureID) { | ||
298 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
299 | return basicSetRequirement(null, msgs); | ||
300 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
301 | return basicSetType(null, msgs); | ||
302 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
303 | return basicSetAllocatedTo(null, msgs); | ||
304 | } | ||
305 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @generated | ||
312 | */ | ||
313 | @Override | ||
314 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
315 | switch (eContainerFeatureID()) { | ||
316 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
317 | return eInternalContainer().eInverseRemove(this, CpsPackage.APPLICATION_TYPE__INSTANCES, | ||
318 | ApplicationType.class, msgs); | ||
319 | } | ||
320 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * <!-- begin-user-doc --> | ||
325 | * <!-- end-user-doc --> | ||
326 | * @generated | ||
327 | */ | ||
328 | @Override | ||
329 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
330 | switch (featureID) { | ||
331 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
332 | if (resolve) | ||
333 | return getRequirement(); | ||
334 | return basicGetRequirement(); | ||
335 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
336 | return getType(); | ||
337 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
338 | if (resolve) | ||
339 | return getAllocatedTo(); | ||
340 | return basicGetAllocatedTo(); | ||
341 | } | ||
342 | return super.eGet(featureID, resolve, coreType); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * <!-- begin-user-doc --> | ||
347 | * <!-- end-user-doc --> | ||
348 | * @generated | ||
349 | */ | ||
350 | @Override | ||
351 | public void eSet(int featureID, Object newValue) { | ||
352 | switch (featureID) { | ||
353 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
354 | setRequirement((Requirement) newValue); | ||
355 | return; | ||
356 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
357 | setType((ApplicationType) newValue); | ||
358 | return; | ||
359 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
360 | setAllocatedTo((HostInstance) newValue); | ||
361 | return; | ||
362 | } | ||
363 | super.eSet(featureID, newValue); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * <!-- begin-user-doc --> | ||
368 | * <!-- end-user-doc --> | ||
369 | * @generated | ||
370 | */ | ||
371 | @Override | ||
372 | public void eUnset(int featureID) { | ||
373 | switch (featureID) { | ||
374 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
375 | setRequirement((Requirement) null); | ||
376 | return; | ||
377 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
378 | setType((ApplicationType) null); | ||
379 | return; | ||
380 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
381 | setAllocatedTo((HostInstance) null); | ||
382 | return; | ||
383 | } | ||
384 | super.eUnset(featureID); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * <!-- begin-user-doc --> | ||
389 | * <!-- end-user-doc --> | ||
390 | * @generated | ||
391 | */ | ||
392 | @Override | ||
393 | public boolean eIsSet(int featureID) { | ||
394 | switch (featureID) { | ||
395 | case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT: | ||
396 | return requirement != null; | ||
397 | case CpsPackage.APPLICATION_INSTANCE__TYPE: | ||
398 | return getType() != null; | ||
399 | case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO: | ||
400 | return allocatedTo != null; | ||
401 | } | ||
402 | return super.eIsSet(featureID); | ||
403 | } | ||
404 | |||
405 | } //ApplicationInstanceImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java new file mode 100644 index 00000000..f8793e30 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java | |||
@@ -0,0 +1,209 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.common.util.EList; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EClass; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
20 | |||
21 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
23 | import org.eclipse.emf.ecore.util.InternalEList; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Application Type</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getInstances <em>Instances</em>}</li> | ||
34 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getRequirements <em>Requirements</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class ApplicationTypeImpl extends MinimalEObjectImpl.Container implements ApplicationType { | ||
40 | /** | ||
41 | * The cached value of the '{@link #getInstances() <em>Instances</em>}' containment reference list. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getInstances() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected EList<ApplicationInstance> instances; | ||
49 | |||
50 | /** | ||
51 | * The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference list. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getRequirements() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected EList<ResourceRequirement> requirements; | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | protected ApplicationTypeImpl() { | ||
66 | super(); | ||
67 | } | ||
68 | |||
69 | /** | ||
70 | * <!-- begin-user-doc --> | ||
71 | * <!-- end-user-doc --> | ||
72 | * @generated | ||
73 | */ | ||
74 | @Override | ||
75 | protected EClass eStaticClass() { | ||
76 | return CpsPackage.Literals.APPLICATION_TYPE; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | public EList<ApplicationInstance> getInstances() { | ||
86 | if (instances == null) { | ||
87 | instances = new EObjectContainmentWithInverseEList<ApplicationInstance>(ApplicationInstance.class, this, | ||
88 | CpsPackage.APPLICATION_TYPE__INSTANCES, CpsPackage.APPLICATION_INSTANCE__TYPE); | ||
89 | } | ||
90 | return instances; | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public EList<ResourceRequirement> getRequirements() { | ||
100 | if (requirements == null) { | ||
101 | requirements = new EObjectContainmentEList<ResourceRequirement>(ResourceRequirement.class, this, | ||
102 | CpsPackage.APPLICATION_TYPE__REQUIREMENTS); | ||
103 | } | ||
104 | return requirements; | ||
105 | } | ||
106 | |||
107 | /** | ||
108 | * <!-- begin-user-doc --> | ||
109 | * <!-- end-user-doc --> | ||
110 | * @generated | ||
111 | */ | ||
112 | @SuppressWarnings("unchecked") | ||
113 | @Override | ||
114 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
115 | switch (featureID) { | ||
116 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
117 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs); | ||
118 | } | ||
119 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * <!-- begin-user-doc --> | ||
124 | * <!-- end-user-doc --> | ||
125 | * @generated | ||
126 | */ | ||
127 | @Override | ||
128 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
129 | switch (featureID) { | ||
130 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
131 | return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs); | ||
132 | case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: | ||
133 | return ((InternalEList<?>) getRequirements()).basicRemove(otherEnd, msgs); | ||
134 | } | ||
135 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * <!-- begin-user-doc --> | ||
140 | * <!-- end-user-doc --> | ||
141 | * @generated | ||
142 | */ | ||
143 | @Override | ||
144 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
145 | switch (featureID) { | ||
146 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
147 | return getInstances(); | ||
148 | case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: | ||
149 | return getRequirements(); | ||
150 | } | ||
151 | return super.eGet(featureID, resolve, coreType); | ||
152 | } | ||
153 | |||
154 | /** | ||
155 | * <!-- begin-user-doc --> | ||
156 | * <!-- end-user-doc --> | ||
157 | * @generated | ||
158 | */ | ||
159 | @SuppressWarnings("unchecked") | ||
160 | @Override | ||
161 | public void eSet(int featureID, Object newValue) { | ||
162 | switch (featureID) { | ||
163 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
164 | getInstances().clear(); | ||
165 | getInstances().addAll((Collection<? extends ApplicationInstance>) newValue); | ||
166 | return; | ||
167 | case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: | ||
168 | getRequirements().clear(); | ||
169 | getRequirements().addAll((Collection<? extends ResourceRequirement>) newValue); | ||
170 | return; | ||
171 | } | ||
172 | super.eSet(featureID, newValue); | ||
173 | } | ||
174 | |||
175 | /** | ||
176 | * <!-- begin-user-doc --> | ||
177 | * <!-- end-user-doc --> | ||
178 | * @generated | ||
179 | */ | ||
180 | @Override | ||
181 | public void eUnset(int featureID) { | ||
182 | switch (featureID) { | ||
183 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
184 | getInstances().clear(); | ||
185 | return; | ||
186 | case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: | ||
187 | getRequirements().clear(); | ||
188 | return; | ||
189 | } | ||
190 | super.eUnset(featureID); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | @Override | ||
199 | public boolean eIsSet(int featureID) { | ||
200 | switch (featureID) { | ||
201 | case CpsPackage.APPLICATION_TYPE__INSTANCES: | ||
202 | return instances != null && !instances.isEmpty(); | ||
203 | case CpsPackage.APPLICATION_TYPE__REQUIREMENTS: | ||
204 | return requirements != null && !requirements.isEmpty(); | ||
205 | } | ||
206 | return super.eIsSet(featureID); | ||
207 | } | ||
208 | |||
209 | } //ApplicationTypeImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java new file mode 100644 index 00000000..110f5abb --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java | |||
@@ -0,0 +1,188 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EPackage; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
12 | |||
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class CpsFactoryImpl extends EFactoryImpl implements CpsFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static CpsFactory init() { | ||
29 | try { | ||
30 | CpsFactory theCpsFactory = (CpsFactory) EPackage.Registry.INSTANCE.getEFactory(CpsPackage.eNS_URI); | ||
31 | if (theCpsFactory != null) { | ||
32 | return theCpsFactory; | ||
33 | } | ||
34 | } catch (Exception exception) { | ||
35 | EcorePlugin.INSTANCE.log(exception); | ||
36 | } | ||
37 | return new CpsFactoryImpl(); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * Creates an instance of the factory. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @generated | ||
45 | */ | ||
46 | public CpsFactoryImpl() { | ||
47 | super(); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * <!-- begin-user-doc --> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @generated | ||
54 | */ | ||
55 | @Override | ||
56 | public EObject create(EClass eClass) { | ||
57 | switch (eClass.getClassifierID()) { | ||
58 | case CpsPackage.CYBER_PHYSICAL_SYSTEM: | ||
59 | return createCyberPhysicalSystem(); | ||
60 | case CpsPackage.APPLICATION_TYPE: | ||
61 | return createApplicationType(); | ||
62 | case CpsPackage.HOST_TYPE: | ||
63 | return createHostType(); | ||
64 | case CpsPackage.REQUEST: | ||
65 | return createRequest(); | ||
66 | case CpsPackage.REQUIREMENT: | ||
67 | return createRequirement(); | ||
68 | case CpsPackage.APPLICATION_INSTANCE: | ||
69 | return createApplicationInstance(); | ||
70 | case CpsPackage.RESOURCE_REQUIREMENT: | ||
71 | return createResourceRequirement(); | ||
72 | case CpsPackage.HOST_INSTANCE: | ||
73 | return createHostInstance(); | ||
74 | default: | ||
75 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | public CyberPhysicalSystem createCyberPhysicalSystem() { | ||
86 | CyberPhysicalSystemImpl cyberPhysicalSystem = new CyberPhysicalSystemImpl(); | ||
87 | return cyberPhysicalSystem; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | @Override | ||
96 | public ApplicationType createApplicationType() { | ||
97 | ApplicationTypeImpl applicationType = new ApplicationTypeImpl(); | ||
98 | return applicationType; | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | @Override | ||
107 | public HostType createHostType() { | ||
108 | HostTypeImpl hostType = new HostTypeImpl(); | ||
109 | return hostType; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public Request createRequest() { | ||
119 | RequestImpl request = new RequestImpl(); | ||
120 | return request; | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | @Override | ||
129 | public Requirement createRequirement() { | ||
130 | RequirementImpl requirement = new RequirementImpl(); | ||
131 | return requirement; | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @generated | ||
138 | */ | ||
139 | @Override | ||
140 | public ApplicationInstance createApplicationInstance() { | ||
141 | ApplicationInstanceImpl applicationInstance = new ApplicationInstanceImpl(); | ||
142 | return applicationInstance; | ||
143 | } | ||
144 | |||
145 | /** | ||
146 | * <!-- begin-user-doc --> | ||
147 | * <!-- end-user-doc --> | ||
148 | * @generated | ||
149 | */ | ||
150 | @Override | ||
151 | public ResourceRequirement createResourceRequirement() { | ||
152 | ResourceRequirementImpl resourceRequirement = new ResourceRequirementImpl(); | ||
153 | return resourceRequirement; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * <!-- begin-user-doc --> | ||
158 | * <!-- end-user-doc --> | ||
159 | * @generated | ||
160 | */ | ||
161 | @Override | ||
162 | public HostInstance createHostInstance() { | ||
163 | HostInstanceImpl hostInstance = new HostInstanceImpl(); | ||
164 | return hostInstance; | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * <!-- begin-user-doc --> | ||
169 | * <!-- end-user-doc --> | ||
170 | * @generated | ||
171 | */ | ||
172 | @Override | ||
173 | public CpsPackage getCpsPackage() { | ||
174 | return (CpsPackage) getEPackage(); | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * <!-- begin-user-doc --> | ||
179 | * <!-- end-user-doc --> | ||
180 | * @deprecated | ||
181 | * @generated | ||
182 | */ | ||
183 | @Deprecated | ||
184 | public static CpsPackage getPackage() { | ||
185 | return CpsPackage.eINSTANCE; | ||
186 | } | ||
187 | |||
188 | } //CpsFactoryImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java new file mode 100644 index 00000000..1f143a64 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java | |||
@@ -0,0 +1,765 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EAttribute; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.EPackage; | ||
19 | import org.eclipse.emf.ecore.EReference; | ||
20 | |||
21 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
22 | |||
23 | /** | ||
24 | * <!-- begin-user-doc --> | ||
25 | * An implementation of the model <b>Package</b>. | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | public class CpsPackageImpl extends EPackageImpl implements CpsPackage { | ||
30 | /** | ||
31 | * <!-- begin-user-doc --> | ||
32 | * <!-- end-user-doc --> | ||
33 | * @generated | ||
34 | */ | ||
35 | private EClass cyberPhysicalSystemEClass = null; | ||
36 | |||
37 | /** | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @generated | ||
41 | */ | ||
42 | private EClass applicationTypeEClass = null; | ||
43 | |||
44 | /** | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <!-- end-user-doc --> | ||
47 | * @generated | ||
48 | */ | ||
49 | private EClass hostTypeEClass = null; | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | private EClass requestEClass = null; | ||
57 | |||
58 | /** | ||
59 | * <!-- begin-user-doc --> | ||
60 | * <!-- end-user-doc --> | ||
61 | * @generated | ||
62 | */ | ||
63 | private EClass requirementEClass = null; | ||
64 | |||
65 | /** | ||
66 | * <!-- begin-user-doc --> | ||
67 | * <!-- end-user-doc --> | ||
68 | * @generated | ||
69 | */ | ||
70 | private EClass applicationInstanceEClass = null; | ||
71 | |||
72 | /** | ||
73 | * <!-- begin-user-doc --> | ||
74 | * <!-- end-user-doc --> | ||
75 | * @generated | ||
76 | */ | ||
77 | private EClass resourceRequirementEClass = null; | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | private EClass hostInstanceEClass = null; | ||
85 | |||
86 | /** | ||
87 | * Creates an instance of the model <b>Package</b>, registered with | ||
88 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
89 | * package URI value. | ||
90 | * <p>Note: the correct way to create the package is via the static | ||
91 | * factory method {@link #init init()}, which also performs | ||
92 | * initialization of the package, or returns the registered package, | ||
93 | * if one already exists. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
97 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#eNS_URI | ||
98 | * @see #init() | ||
99 | * @generated | ||
100 | */ | ||
101 | private CpsPackageImpl() { | ||
102 | super(eNS_URI, CpsFactory.eINSTANCE); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @generated | ||
109 | */ | ||
110 | private static boolean isInited = false; | ||
111 | |||
112 | /** | ||
113 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
114 | * | ||
115 | * <p>This method is used to initialize {@link CpsPackage#eINSTANCE} when that field is accessed. | ||
116 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
117 | * <!-- begin-user-doc --> | ||
118 | * <!-- end-user-doc --> | ||
119 | * @see #eNS_URI | ||
120 | * @see #createPackageContents() | ||
121 | * @see #initializePackageContents() | ||
122 | * @generated | ||
123 | */ | ||
124 | public static CpsPackage init() { | ||
125 | if (isInited) | ||
126 | return (CpsPackage) EPackage.Registry.INSTANCE.getEPackage(CpsPackage.eNS_URI); | ||
127 | |||
128 | // Obtain or create and register package | ||
129 | Object registeredCpsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
130 | CpsPackageImpl theCpsPackage = registeredCpsPackage instanceof CpsPackageImpl | ||
131 | ? (CpsPackageImpl) registeredCpsPackage | ||
132 | : new CpsPackageImpl(); | ||
133 | |||
134 | isInited = true; | ||
135 | |||
136 | // Create package meta-data objects | ||
137 | theCpsPackage.createPackageContents(); | ||
138 | |||
139 | // Initialize created meta-data | ||
140 | theCpsPackage.initializePackageContents(); | ||
141 | |||
142 | // Mark meta-data to indicate it can't be changed | ||
143 | theCpsPackage.freeze(); | ||
144 | |||
145 | // Update the registry and return the package | ||
146 | EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, theCpsPackage); | ||
147 | return theCpsPackage; | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * <!-- begin-user-doc --> | ||
152 | * <!-- end-user-doc --> | ||
153 | * @generated | ||
154 | */ | ||
155 | @Override | ||
156 | public EClass getCyberPhysicalSystem() { | ||
157 | return cyberPhysicalSystemEClass; | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * <!-- begin-user-doc --> | ||
162 | * <!-- end-user-doc --> | ||
163 | * @generated | ||
164 | */ | ||
165 | @Override | ||
166 | public EReference getCyberPhysicalSystem_Requests() { | ||
167 | return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(0); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @Override | ||
176 | public EReference getCyberPhysicalSystem_ApplicationTypes() { | ||
177 | return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(1); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @generated | ||
184 | */ | ||
185 | @Override | ||
186 | public EReference getCyberPhysicalSystem_HostTypes() { | ||
187 | return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(2); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * <!-- begin-user-doc --> | ||
192 | * <!-- end-user-doc --> | ||
193 | * @generated | ||
194 | */ | ||
195 | @Override | ||
196 | public EReference getCyberPhysicalSystem_Hosts() { | ||
197 | return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(3); | ||
198 | } | ||
199 | |||
200 | /** | ||
201 | * <!-- begin-user-doc --> | ||
202 | * <!-- end-user-doc --> | ||
203 | * @generated | ||
204 | */ | ||
205 | @Override | ||
206 | public EReference getCyberPhysicalSystem_Applications() { | ||
207 | return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(4); | ||
208 | } | ||
209 | |||
210 | /** | ||
211 | * <!-- begin-user-doc --> | ||
212 | * <!-- end-user-doc --> | ||
213 | * @generated | ||
214 | */ | ||
215 | @Override | ||
216 | public EClass getApplicationType() { | ||
217 | return applicationTypeEClass; | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public EReference getApplicationType_Instances() { | ||
227 | return (EReference) applicationTypeEClass.getEStructuralFeatures().get(0); | ||
228 | } | ||
229 | |||
230 | /** | ||
231 | * <!-- begin-user-doc --> | ||
232 | * <!-- end-user-doc --> | ||
233 | * @generated | ||
234 | */ | ||
235 | @Override | ||
236 | public EReference getApplicationType_Requirements() { | ||
237 | return (EReference) applicationTypeEClass.getEStructuralFeatures().get(1); | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * <!-- begin-user-doc --> | ||
242 | * <!-- end-user-doc --> | ||
243 | * @generated | ||
244 | */ | ||
245 | @Override | ||
246 | public EClass getHostType() { | ||
247 | return hostTypeEClass; | ||
248 | } | ||
249 | |||
250 | /** | ||
251 | * <!-- begin-user-doc --> | ||
252 | * <!-- end-user-doc --> | ||
253 | * @generated | ||
254 | */ | ||
255 | @Override | ||
256 | public EAttribute getHostType_DefaultMemory() { | ||
257 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(0); | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * <!-- begin-user-doc --> | ||
262 | * <!-- end-user-doc --> | ||
263 | * @generated | ||
264 | */ | ||
265 | @Override | ||
266 | public EAttribute getHostType_DefaultHdd() { | ||
267 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(1); | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * <!-- begin-user-doc --> | ||
272 | * <!-- end-user-doc --> | ||
273 | * @generated | ||
274 | */ | ||
275 | @Override | ||
276 | public EReference getHostType_Instances() { | ||
277 | return (EReference) hostTypeEClass.getEStructuralFeatures().get(2); | ||
278 | } | ||
279 | |||
280 | /** | ||
281 | * <!-- begin-user-doc --> | ||
282 | * <!-- end-user-doc --> | ||
283 | * @generated | ||
284 | */ | ||
285 | @Override | ||
286 | public EAttribute getHostType_Cost() { | ||
287 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(3); | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * <!-- begin-user-doc --> | ||
292 | * <!-- end-user-doc --> | ||
293 | * @generated | ||
294 | */ | ||
295 | @Override | ||
296 | public EClass getRequest() { | ||
297 | return requestEClass; | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * <!-- begin-user-doc --> | ||
302 | * <!-- end-user-doc --> | ||
303 | * @generated | ||
304 | */ | ||
305 | @Override | ||
306 | public EReference getRequest_Requirements() { | ||
307 | return (EReference) requestEClass.getEStructuralFeatures().get(0); | ||
308 | } | ||
309 | |||
310 | /** | ||
311 | * <!-- begin-user-doc --> | ||
312 | * <!-- end-user-doc --> | ||
313 | * @generated | ||
314 | */ | ||
315 | @Override | ||
316 | public EClass getRequirement() { | ||
317 | return requirementEClass; | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * <!-- begin-user-doc --> | ||
322 | * <!-- end-user-doc --> | ||
323 | * @generated | ||
324 | */ | ||
325 | @Override | ||
326 | public EReference getRequirement_Request() { | ||
327 | return (EReference) requirementEClass.getEStructuralFeatures().get(0); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * <!-- begin-user-doc --> | ||
332 | * <!-- end-user-doc --> | ||
333 | * @generated | ||
334 | */ | ||
335 | @Override | ||
336 | public EAttribute getRequirement_Count() { | ||
337 | return (EAttribute) requirementEClass.getEStructuralFeatures().get(1); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * <!-- begin-user-doc --> | ||
342 | * <!-- end-user-doc --> | ||
343 | * @generated | ||
344 | */ | ||
345 | @Override | ||
346 | public EReference getRequirement_Type() { | ||
347 | return (EReference) requirementEClass.getEStructuralFeatures().get(2); | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * <!-- begin-user-doc --> | ||
352 | * <!-- end-user-doc --> | ||
353 | * @generated | ||
354 | */ | ||
355 | @Override | ||
356 | public EReference getRequirement_Instances() { | ||
357 | return (EReference) requirementEClass.getEStructuralFeatures().get(3); | ||
358 | } | ||
359 | |||
360 | /** | ||
361 | * <!-- begin-user-doc --> | ||
362 | * <!-- end-user-doc --> | ||
363 | * @generated | ||
364 | */ | ||
365 | @Override | ||
366 | public EClass getApplicationInstance() { | ||
367 | return applicationInstanceEClass; | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * <!-- begin-user-doc --> | ||
372 | * <!-- end-user-doc --> | ||
373 | * @generated | ||
374 | */ | ||
375 | @Override | ||
376 | public EReference getApplicationInstance_Requirement() { | ||
377 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(0); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * <!-- begin-user-doc --> | ||
382 | * <!-- end-user-doc --> | ||
383 | * @generated | ||
384 | */ | ||
385 | @Override | ||
386 | public EReference getApplicationInstance_Type() { | ||
387 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(1); | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * <!-- begin-user-doc --> | ||
392 | * <!-- end-user-doc --> | ||
393 | * @generated | ||
394 | */ | ||
395 | @Override | ||
396 | public EReference getApplicationInstance_AllocatedTo() { | ||
397 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(2); | ||
398 | } | ||
399 | |||
400 | /** | ||
401 | * <!-- begin-user-doc --> | ||
402 | * <!-- end-user-doc --> | ||
403 | * @generated | ||
404 | */ | ||
405 | @Override | ||
406 | public EClass getResourceRequirement() { | ||
407 | return resourceRequirementEClass; | ||
408 | } | ||
409 | |||
410 | /** | ||
411 | * <!-- begin-user-doc --> | ||
412 | * <!-- end-user-doc --> | ||
413 | * @generated | ||
414 | */ | ||
415 | @Override | ||
416 | public EAttribute getResourceRequirement_RequiredMemory() { | ||
417 | return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(0); | ||
418 | } | ||
419 | |||
420 | /** | ||
421 | * <!-- begin-user-doc --> | ||
422 | * <!-- end-user-doc --> | ||
423 | * @generated | ||
424 | */ | ||
425 | @Override | ||
426 | public EAttribute getResourceRequirement_RequiredHdd() { | ||
427 | return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(1); | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * <!-- begin-user-doc --> | ||
432 | * <!-- end-user-doc --> | ||
433 | * @generated | ||
434 | */ | ||
435 | @Override | ||
436 | public EReference getResourceRequirement_HostType() { | ||
437 | return (EReference) resourceRequirementEClass.getEStructuralFeatures().get(2); | ||
438 | } | ||
439 | |||
440 | /** | ||
441 | * <!-- begin-user-doc --> | ||
442 | * <!-- end-user-doc --> | ||
443 | * @generated | ||
444 | */ | ||
445 | @Override | ||
446 | public EClass getHostInstance() { | ||
447 | return hostInstanceEClass; | ||
448 | } | ||
449 | |||
450 | /** | ||
451 | * <!-- begin-user-doc --> | ||
452 | * <!-- end-user-doc --> | ||
453 | * @generated | ||
454 | */ | ||
455 | @Override | ||
456 | public EReference getHostInstance_Type() { | ||
457 | return (EReference) hostInstanceEClass.getEStructuralFeatures().get(0); | ||
458 | } | ||
459 | |||
460 | /** | ||
461 | * <!-- begin-user-doc --> | ||
462 | * <!-- end-user-doc --> | ||
463 | * @generated | ||
464 | */ | ||
465 | @Override | ||
466 | public EAttribute getHostInstance_AvailableMemory() { | ||
467 | return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(1); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * <!-- begin-user-doc --> | ||
472 | * <!-- end-user-doc --> | ||
473 | * @generated | ||
474 | */ | ||
475 | @Override | ||
476 | public EAttribute getHostInstance_AvailableHdd() { | ||
477 | return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(2); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * <!-- begin-user-doc --> | ||
482 | * <!-- end-user-doc --> | ||
483 | * @generated | ||
484 | */ | ||
485 | @Override | ||
486 | public EAttribute getHostInstance_TotalMemory() { | ||
487 | return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(3); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * <!-- begin-user-doc --> | ||
492 | * <!-- end-user-doc --> | ||
493 | * @generated | ||
494 | */ | ||
495 | @Override | ||
496 | public EAttribute getHostInstance_TotalHdd() { | ||
497 | return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(4); | ||
498 | } | ||
499 | |||
500 | /** | ||
501 | * <!-- begin-user-doc --> | ||
502 | * <!-- end-user-doc --> | ||
503 | * @generated | ||
504 | */ | ||
505 | @Override | ||
506 | public EReference getHostInstance_Applications() { | ||
507 | return (EReference) hostInstanceEClass.getEStructuralFeatures().get(5); | ||
508 | } | ||
509 | |||
510 | /** | ||
511 | * <!-- begin-user-doc --> | ||
512 | * <!-- end-user-doc --> | ||
513 | * @generated | ||
514 | */ | ||
515 | @Override | ||
516 | public CpsFactory getCpsFactory() { | ||
517 | return (CpsFactory) getEFactoryInstance(); | ||
518 | } | ||
519 | |||
520 | /** | ||
521 | * <!-- begin-user-doc --> | ||
522 | * <!-- end-user-doc --> | ||
523 | * @generated | ||
524 | */ | ||
525 | private boolean isCreated = false; | ||
526 | |||
527 | /** | ||
528 | * Creates the meta-model objects for the package. This method is | ||
529 | * guarded to have no affect on any invocation but its first. | ||
530 | * <!-- begin-user-doc --> | ||
531 | * <!-- end-user-doc --> | ||
532 | * @generated | ||
533 | */ | ||
534 | public void createPackageContents() { | ||
535 | if (isCreated) | ||
536 | return; | ||
537 | isCreated = true; | ||
538 | |||
539 | // Create classes and their features | ||
540 | cyberPhysicalSystemEClass = createEClass(CYBER_PHYSICAL_SYSTEM); | ||
541 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS); | ||
542 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); | ||
543 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES); | ||
544 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOSTS); | ||
545 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATIONS); | ||
546 | |||
547 | applicationTypeEClass = createEClass(APPLICATION_TYPE); | ||
548 | createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES); | ||
549 | createEReference(applicationTypeEClass, APPLICATION_TYPE__REQUIREMENTS); | ||
550 | |||
551 | hostTypeEClass = createEClass(HOST_TYPE); | ||
552 | createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_MEMORY); | ||
553 | createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_HDD); | ||
554 | createEReference(hostTypeEClass, HOST_TYPE__INSTANCES); | ||
555 | createEAttribute(hostTypeEClass, HOST_TYPE__COST); | ||
556 | |||
557 | requestEClass = createEClass(REQUEST); | ||
558 | createEReference(requestEClass, REQUEST__REQUIREMENTS); | ||
559 | |||
560 | requirementEClass = createEClass(REQUIREMENT); | ||
561 | createEReference(requirementEClass, REQUIREMENT__REQUEST); | ||
562 | createEAttribute(requirementEClass, REQUIREMENT__COUNT); | ||
563 | createEReference(requirementEClass, REQUIREMENT__TYPE); | ||
564 | createEReference(requirementEClass, REQUIREMENT__INSTANCES); | ||
565 | |||
566 | applicationInstanceEClass = createEClass(APPLICATION_INSTANCE); | ||
567 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__REQUIREMENT); | ||
568 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__TYPE); | ||
569 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__ALLOCATED_TO); | ||
570 | |||
571 | resourceRequirementEClass = createEClass(RESOURCE_REQUIREMENT); | ||
572 | createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_MEMORY); | ||
573 | createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_HDD); | ||
574 | createEReference(resourceRequirementEClass, RESOURCE_REQUIREMENT__HOST_TYPE); | ||
575 | |||
576 | hostInstanceEClass = createEClass(HOST_INSTANCE); | ||
577 | createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE); | ||
578 | createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_MEMORY); | ||
579 | createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_HDD); | ||
580 | createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_MEMORY); | ||
581 | createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_HDD); | ||
582 | createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS); | ||
583 | } | ||
584 | |||
585 | /** | ||
586 | * <!-- begin-user-doc --> | ||
587 | * <!-- end-user-doc --> | ||
588 | * @generated | ||
589 | */ | ||
590 | private boolean isInitialized = false; | ||
591 | |||
592 | /** | ||
593 | * Complete the initialization of the package and its meta-model. This | ||
594 | * method is guarded to have no affect on any invocation but its first. | ||
595 | * <!-- begin-user-doc --> | ||
596 | * <!-- end-user-doc --> | ||
597 | * @generated | ||
598 | */ | ||
599 | public void initializePackageContents() { | ||
600 | if (isInitialized) | ||
601 | return; | ||
602 | isInitialized = true; | ||
603 | |||
604 | // Initialize package | ||
605 | setName(eNAME); | ||
606 | setNsPrefix(eNS_PREFIX); | ||
607 | setNsURI(eNS_URI); | ||
608 | |||
609 | // Create type parameters | ||
610 | |||
611 | // Set bounds for type parameters | ||
612 | |||
613 | // Add supertypes to classes | ||
614 | |||
615 | // Initialize classes, features, and operations; add parameters | ||
616 | initEClass(cyberPhysicalSystemEClass, CyberPhysicalSystem.class, "CyberPhysicalSystem", !IS_ABSTRACT, | ||
617 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
618 | initEReference(getCyberPhysicalSystem_Requests(), this.getRequest(), null, "requests", null, 0, -1, | ||
619 | CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
620 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
621 | initEReference(getCyberPhysicalSystem_ApplicationTypes(), this.getApplicationType(), null, "applicationTypes", | ||
622 | null, 0, -1, CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
623 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
624 | initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1, | ||
625 | CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
626 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
627 | initEReference(getCyberPhysicalSystem_Hosts(), this.getHostInstance(), null, "hosts", null, 0, -1, | ||
628 | CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, | ||
629 | !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); | ||
630 | initEReference(getCyberPhysicalSystem_Applications(), this.getApplicationInstance(), null, "applications", null, | ||
631 | 0, -1, CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, | ||
632 | IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); | ||
633 | |||
634 | initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE, | ||
635 | IS_GENERATED_INSTANCE_CLASS); | ||
636 | initEReference(getApplicationType_Instances(), this.getApplicationInstance(), | ||
637 | this.getApplicationInstance_Type(), "instances", null, 0, -1, ApplicationType.class, !IS_TRANSIENT, | ||
638 | !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
639 | IS_ORDERED); | ||
640 | initEReference(getApplicationType_Requirements(), this.getResourceRequirement(), null, "requirements", null, 0, | ||
641 | -1, ApplicationType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
642 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
643 | |||
644 | initEClass(hostTypeEClass, HostType.class, "HostType", !IS_ABSTRACT, !IS_INTERFACE, | ||
645 | IS_GENERATED_INSTANCE_CLASS); | ||
646 | initEAttribute(getHostType_DefaultMemory(), ecorePackage.getEInt(), "defaultMemory", null, 1, 1, HostType.class, | ||
647 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
648 | initEAttribute(getHostType_DefaultHdd(), ecorePackage.getEInt(), "defaultHdd", null, 1, 1, HostType.class, | ||
649 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
650 | initEReference(getHostType_Instances(), this.getHostInstance(), this.getHostInstance_Type(), "instances", null, | ||
651 | 0, -1, HostType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
652 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
653 | initEAttribute(getHostType_Cost(), ecorePackage.getEInt(), "cost", null, 1, 1, HostType.class, !IS_TRANSIENT, | ||
654 | !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
655 | |||
656 | initEClass(requestEClass, Request.class, "Request", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
657 | initEReference(getRequest_Requirements(), this.getRequirement(), this.getRequirement_Request(), "requirements", | ||
658 | null, 0, -1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
659 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
660 | |||
661 | initEClass(requirementEClass, Requirement.class, "Requirement", !IS_ABSTRACT, !IS_INTERFACE, | ||
662 | IS_GENERATED_INSTANCE_CLASS); | ||
663 | initEReference(getRequirement_Request(), this.getRequest(), this.getRequest_Requirements(), "request", null, 1, | ||
664 | 1, Requirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
665 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
666 | initEAttribute(getRequirement_Count(), ecorePackage.getEInt(), "count", null, 1, 1, Requirement.class, | ||
667 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
668 | initEReference(getRequirement_Type(), this.getApplicationType(), null, "type", null, 0, 1, Requirement.class, | ||
669 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
670 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
671 | initEReference(getRequirement_Instances(), this.getApplicationInstance(), | ||
672 | this.getApplicationInstance_Requirement(), "instances", null, 0, -1, Requirement.class, !IS_TRANSIENT, | ||
673 | !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
674 | IS_ORDERED); | ||
675 | |||
676 | initEClass(applicationInstanceEClass, ApplicationInstance.class, "ApplicationInstance", !IS_ABSTRACT, | ||
677 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
678 | initEReference(getApplicationInstance_Requirement(), this.getRequirement(), this.getRequirement_Instances(), | ||
679 | "requirement", null, 0, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, | ||
680 | !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
681 | initEReference(getApplicationInstance_Type(), this.getApplicationType(), this.getApplicationType_Instances(), | ||
682 | "type", null, 1, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, | ||
683 | !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
684 | initEReference(getApplicationInstance_AllocatedTo(), this.getHostInstance(), | ||
685 | this.getHostInstance_Applications(), "allocatedTo", null, 1, 1, ApplicationInstance.class, | ||
686 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
687 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
688 | |||
689 | initEClass(resourceRequirementEClass, ResourceRequirement.class, "ResourceRequirement", !IS_ABSTRACT, | ||
690 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
691 | initEAttribute(getResourceRequirement_RequiredMemory(), ecorePackage.getEInt(), "requiredMemory", null, 1, 1, | ||
692 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, | ||
693 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
694 | initEAttribute(getResourceRequirement_RequiredHdd(), ecorePackage.getEInt(), "requiredHdd", null, 1, 1, | ||
695 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, | ||
696 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
697 | initEReference(getResourceRequirement_HostType(), this.getHostType(), null, "hostType", null, 1, 1, | ||
698 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, | ||
699 | IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
700 | |||
701 | initEClass(hostInstanceEClass, HostInstance.class, "HostInstance", !IS_ABSTRACT, !IS_INTERFACE, | ||
702 | IS_GENERATED_INSTANCE_CLASS); | ||
703 | initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1, | ||
704 | HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
705 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
706 | initEAttribute(getHostInstance_AvailableMemory(), ecorePackage.getEInt(), "availableMemory", null, 0, 1, | ||
707 | HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, | ||
708 | IS_DERIVED, IS_ORDERED); | ||
709 | initEAttribute(getHostInstance_AvailableHdd(), ecorePackage.getEInt(), "availableHdd", null, 0, 1, | ||
710 | HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, | ||
711 | IS_DERIVED, IS_ORDERED); | ||
712 | initEAttribute(getHostInstance_TotalMemory(), ecorePackage.getEInt(), "totalMemory", null, 0, 1, | ||
713 | HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, | ||
714 | IS_DERIVED, IS_ORDERED); | ||
715 | initEAttribute(getHostInstance_TotalHdd(), ecorePackage.getEInt(), "totalHdd", null, 0, 1, HostInstance.class, | ||
716 | IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED); | ||
717 | initEReference(getHostInstance_Applications(), this.getApplicationInstance(), | ||
718 | this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class, | ||
719 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
720 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
721 | |||
722 | // Create resource | ||
723 | createResource(eNS_URI); | ||
724 | |||
725 | // Create annotations | ||
726 | // http://www.eclipse.org/emf/2002/Ecore | ||
727 | createEcoreAnnotations(); | ||
728 | // org.eclipse.viatra.query.querybasedfeature | ||
729 | createOrgAnnotations(); | ||
730 | } | ||
731 | |||
732 | /** | ||
733 | * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. | ||
734 | * <!-- begin-user-doc --> | ||
735 | * <!-- end-user-doc --> | ||
736 | * @generated | ||
737 | */ | ||
738 | protected void createEcoreAnnotations() { | ||
739 | String source = "http://www.eclipse.org/emf/2002/Ecore"; | ||
740 | addAnnotation(this, source, new String[] { "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" }); | ||
741 | } | ||
742 | |||
743 | /** | ||
744 | * Initializes the annotations for <b>org.eclipse.viatra.query.querybasedfeature</b>. | ||
745 | * <!-- begin-user-doc --> | ||
746 | * <!-- end-user-doc --> | ||
747 | * @generated | ||
748 | */ | ||
749 | protected void createOrgAnnotations() { | ||
750 | String source = "org.eclipse.viatra.query.querybasedfeature"; | ||
751 | addAnnotation(getCyberPhysicalSystem_Hosts(), source, | ||
752 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" }); | ||
753 | addAnnotation(getCyberPhysicalSystem_Applications(), source, | ||
754 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" }); | ||
755 | addAnnotation(getHostInstance_AvailableMemory(), source, | ||
756 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" }); | ||
757 | addAnnotation(getHostInstance_AvailableHdd(), source, | ||
758 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" }); | ||
759 | addAnnotation(getHostInstance_TotalMemory(), source, | ||
760 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" }); | ||
761 | addAnnotation(getHostInstance_TotalHdd(), source, | ||
762 | new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" }); | ||
763 | } | ||
764 | |||
765 | } //CpsPackageImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java new file mode 100644 index 00000000..4d254f25 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java | |||
@@ -0,0 +1,289 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
12 | |||
13 | import java.util.Collection; | ||
14 | |||
15 | import org.eclipse.emf.common.notify.NotificationChain; | ||
16 | |||
17 | import org.eclipse.emf.common.util.EList; | ||
18 | |||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
21 | import org.eclipse.emf.ecore.InternalEObject; | ||
22 | |||
23 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
24 | |||
25 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
26 | import org.eclipse.emf.ecore.util.InternalEList; | ||
27 | |||
28 | /** | ||
29 | * <!-- begin-user-doc --> | ||
30 | * An implementation of the model object '<em><b>Cyber Physical System</b></em>'. | ||
31 | * <!-- end-user-doc --> | ||
32 | * <p> | ||
33 | * The following features are implemented: | ||
34 | * </p> | ||
35 | * <ul> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests <em>Requests</em>}</li> | ||
37 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes <em>Application Types</em>}</li> | ||
38 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes <em>Host Types</em>}</li> | ||
39 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHosts <em>Hosts</em>}</li> | ||
40 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplications <em>Applications</em>}</li> | ||
41 | * </ul> | ||
42 | * | ||
43 | * @generated | ||
44 | */ | ||
45 | public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implements CyberPhysicalSystem { | ||
46 | /** | ||
47 | * The cached value of the '{@link #getRequests() <em>Requests</em>}' containment reference list. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @see #getRequests() | ||
51 | * @generated | ||
52 | * @ordered | ||
53 | */ | ||
54 | protected EList<Request> requests; | ||
55 | |||
56 | /** | ||
57 | * The cached value of the '{@link #getApplicationTypes() <em>Application Types</em>}' containment reference list. | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @see #getApplicationTypes() | ||
61 | * @generated | ||
62 | * @ordered | ||
63 | */ | ||
64 | protected EList<ApplicationType> applicationTypes; | ||
65 | |||
66 | /** | ||
67 | * The cached value of the '{@link #getHostTypes() <em>Host Types</em>}' containment reference list. | ||
68 | * <!-- begin-user-doc --> | ||
69 | * <!-- end-user-doc --> | ||
70 | * @see #getHostTypes() | ||
71 | * @generated | ||
72 | * @ordered | ||
73 | */ | ||
74 | protected EList<HostType> hostTypes; | ||
75 | |||
76 | /** | ||
77 | * The cached setting delegate for the '{@link #getHosts() <em>Hosts</em>}' reference list. | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @see #getHosts() | ||
81 | * @generated | ||
82 | * @ordered | ||
83 | */ | ||
84 | protected EStructuralFeature.Internal.SettingDelegate HOSTS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__HOSTS) | ||
85 | .getSettingDelegate(); | ||
86 | |||
87 | /** | ||
88 | * The cached setting delegate for the '{@link #getApplications() <em>Applications</em>}' reference list. | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @see #getApplications() | ||
92 | * @generated | ||
93 | * @ordered | ||
94 | */ | ||
95 | protected EStructuralFeature.Internal.SettingDelegate APPLICATIONS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__APPLICATIONS) | ||
96 | .getSettingDelegate(); | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | protected CyberPhysicalSystemImpl() { | ||
104 | super(); | ||
105 | } | ||
106 | |||
107 | /** | ||
108 | * <!-- begin-user-doc --> | ||
109 | * <!-- end-user-doc --> | ||
110 | * @generated | ||
111 | */ | ||
112 | @Override | ||
113 | protected EClass eStaticClass() { | ||
114 | return CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM; | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | */ | ||
122 | @Override | ||
123 | public EList<Request> getRequests() { | ||
124 | if (requests == null) { | ||
125 | requests = new EObjectContainmentEList<Request>(Request.class, this, | ||
126 | CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS); | ||
127 | } | ||
128 | return requests; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @Override | ||
137 | public EList<ApplicationType> getApplicationTypes() { | ||
138 | if (applicationTypes == null) { | ||
139 | applicationTypes = new EObjectContainmentEList<ApplicationType>(ApplicationType.class, this, | ||
140 | CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); | ||
141 | } | ||
142 | return applicationTypes; | ||
143 | } | ||
144 | |||
145 | /** | ||
146 | * <!-- begin-user-doc --> | ||
147 | * <!-- end-user-doc --> | ||
148 | * @generated | ||
149 | */ | ||
150 | @Override | ||
151 | public EList<HostType> getHostTypes() { | ||
152 | if (hostTypes == null) { | ||
153 | hostTypes = new EObjectContainmentEList<HostType>(HostType.class, this, | ||
154 | CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES); | ||
155 | } | ||
156 | return hostTypes; | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | @SuppressWarnings("unchecked") | ||
165 | @Override | ||
166 | public EList<HostInstance> getHosts() { | ||
167 | return (EList<HostInstance>) HOSTS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @SuppressWarnings("unchecked") | ||
176 | @Override | ||
177 | public EList<ApplicationInstance> getApplications() { | ||
178 | return (EList<ApplicationInstance>) APPLICATIONS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | @Override | ||
187 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
188 | switch (featureID) { | ||
189 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
190 | return ((InternalEList<?>) getRequests()).basicRemove(otherEnd, msgs); | ||
191 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
192 | return ((InternalEList<?>) getApplicationTypes()).basicRemove(otherEnd, msgs); | ||
193 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
194 | return ((InternalEList<?>) getHostTypes()).basicRemove(otherEnd, msgs); | ||
195 | } | ||
196 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * <!-- begin-user-doc --> | ||
201 | * <!-- end-user-doc --> | ||
202 | * @generated | ||
203 | */ | ||
204 | @Override | ||
205 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
206 | switch (featureID) { | ||
207 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
208 | return getRequests(); | ||
209 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
210 | return getApplicationTypes(); | ||
211 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
212 | return getHostTypes(); | ||
213 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS: | ||
214 | return getHosts(); | ||
215 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS: | ||
216 | return getApplications(); | ||
217 | } | ||
218 | return super.eGet(featureID, resolve, coreType); | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * <!-- begin-user-doc --> | ||
223 | * <!-- end-user-doc --> | ||
224 | * @generated | ||
225 | */ | ||
226 | @SuppressWarnings("unchecked") | ||
227 | @Override | ||
228 | public void eSet(int featureID, Object newValue) { | ||
229 | switch (featureID) { | ||
230 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
231 | getRequests().clear(); | ||
232 | getRequests().addAll((Collection<? extends Request>) newValue); | ||
233 | return; | ||
234 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
235 | getApplicationTypes().clear(); | ||
236 | getApplicationTypes().addAll((Collection<? extends ApplicationType>) newValue); | ||
237 | return; | ||
238 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
239 | getHostTypes().clear(); | ||
240 | getHostTypes().addAll((Collection<? extends HostType>) newValue); | ||
241 | return; | ||
242 | } | ||
243 | super.eSet(featureID, newValue); | ||
244 | } | ||
245 | |||
246 | /** | ||
247 | * <!-- begin-user-doc --> | ||
248 | * <!-- end-user-doc --> | ||
249 | * @generated | ||
250 | */ | ||
251 | @Override | ||
252 | public void eUnset(int featureID) { | ||
253 | switch (featureID) { | ||
254 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
255 | getRequests().clear(); | ||
256 | return; | ||
257 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
258 | getApplicationTypes().clear(); | ||
259 | return; | ||
260 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
261 | getHostTypes().clear(); | ||
262 | return; | ||
263 | } | ||
264 | super.eUnset(featureID); | ||
265 | } | ||
266 | |||
267 | /** | ||
268 | * <!-- begin-user-doc --> | ||
269 | * <!-- end-user-doc --> | ||
270 | * @generated | ||
271 | */ | ||
272 | @Override | ||
273 | public boolean eIsSet(int featureID) { | ||
274 | switch (featureID) { | ||
275 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
276 | return requests != null && !requests.isEmpty(); | ||
277 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
278 | return applicationTypes != null && !applicationTypes.isEmpty(); | ||
279 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
280 | return hostTypes != null && !hostTypes.isEmpty(); | ||
281 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS: | ||
282 | return HOSTS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
283 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS: | ||
284 | return APPLICATIONS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
285 | } | ||
286 | return super.eIsSet(featureID); | ||
287 | } | ||
288 | |||
289 | } //CyberPhysicalSystemImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java new file mode 100644 index 00000000..bbaca59c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java | |||
@@ -0,0 +1,355 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.Notification; | ||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
16 | |||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
19 | import org.eclipse.emf.ecore.InternalEObject; | ||
20 | |||
21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
22 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
23 | |||
24 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
25 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
26 | import org.eclipse.emf.ecore.util.InternalEList; | ||
27 | |||
28 | /** | ||
29 | * <!-- begin-user-doc --> | ||
30 | * An implementation of the model object '<em><b>Host Instance</b></em>'. | ||
31 | * <!-- end-user-doc --> | ||
32 | * <p> | ||
33 | * The following features are implemented: | ||
34 | * </p> | ||
35 | * <ul> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li> | ||
37 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableMemory <em>Available Memory</em>}</li> | ||
38 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableHdd <em>Available Hdd</em>}</li> | ||
39 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalMemory <em>Total Memory</em>}</li> | ||
40 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalHdd <em>Total Hdd</em>}</li> | ||
41 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li> | ||
42 | * </ul> | ||
43 | * | ||
44 | * @generated | ||
45 | */ | ||
46 | public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance { | ||
47 | /** | ||
48 | * The cached setting delegate for the '{@link #getAvailableMemory() <em>Available Memory</em>}' attribute. | ||
49 | * <!-- begin-user-doc --> | ||
50 | * <!-- end-user-doc --> | ||
51 | * @see #getAvailableMemory() | ||
52 | * @generated | ||
53 | * @ordered | ||
54 | */ | ||
55 | protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_MEMORY) | ||
56 | .getSettingDelegate(); | ||
57 | |||
58 | /** | ||
59 | * The cached setting delegate for the '{@link #getAvailableHdd() <em>Available Hdd</em>}' attribute. | ||
60 | * <!-- begin-user-doc --> | ||
61 | * <!-- end-user-doc --> | ||
62 | * @see #getAvailableHdd() | ||
63 | * @generated | ||
64 | * @ordered | ||
65 | */ | ||
66 | protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_HDD) | ||
67 | .getSettingDelegate(); | ||
68 | |||
69 | /** | ||
70 | * The cached setting delegate for the '{@link #getTotalMemory() <em>Total Memory</em>}' attribute. | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @see #getTotalMemory() | ||
74 | * @generated | ||
75 | * @ordered | ||
76 | */ | ||
77 | protected EStructuralFeature.Internal.SettingDelegate TOTAL_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_MEMORY) | ||
78 | .getSettingDelegate(); | ||
79 | |||
80 | /** | ||
81 | * The cached setting delegate for the '{@link #getTotalHdd() <em>Total Hdd</em>}' attribute. | ||
82 | * <!-- begin-user-doc --> | ||
83 | * <!-- end-user-doc --> | ||
84 | * @see #getTotalHdd() | ||
85 | * @generated | ||
86 | * @ordered | ||
87 | */ | ||
88 | protected EStructuralFeature.Internal.SettingDelegate TOTAL_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_HDD) | ||
89 | .getSettingDelegate(); | ||
90 | |||
91 | /** | ||
92 | * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list. | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @see #getApplications() | ||
96 | * @generated | ||
97 | * @ordered | ||
98 | */ | ||
99 | protected EList<ApplicationInstance> applications; | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | protected HostInstanceImpl() { | ||
107 | super(); | ||
108 | } | ||
109 | |||
110 | /** | ||
111 | * <!-- begin-user-doc --> | ||
112 | * <!-- end-user-doc --> | ||
113 | * @generated | ||
114 | */ | ||
115 | @Override | ||
116 | protected EClass eStaticClass() { | ||
117 | return CpsPackage.Literals.HOST_INSTANCE; | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * <!-- begin-user-doc --> | ||
122 | * <!-- end-user-doc --> | ||
123 | * @generated | ||
124 | */ | ||
125 | @Override | ||
126 | public HostType getType() { | ||
127 | if (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE) | ||
128 | return null; | ||
129 | return (HostType) eInternalContainer(); | ||
130 | } | ||
131 | |||
132 | /** | ||
133 | * <!-- begin-user-doc --> | ||
134 | * <!-- end-user-doc --> | ||
135 | * @generated | ||
136 | */ | ||
137 | public NotificationChain basicSetType(HostType newType, NotificationChain msgs) { | ||
138 | msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.HOST_INSTANCE__TYPE, msgs); | ||
139 | return msgs; | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | @Override | ||
148 | public void setType(HostType newType) { | ||
149 | if (newType != eInternalContainer() | ||
150 | || (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE && newType != null)) { | ||
151 | if (EcoreUtil.isAncestor(this, newType)) | ||
152 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
153 | NotificationChain msgs = null; | ||
154 | if (eInternalContainer() != null) | ||
155 | msgs = eBasicRemoveFromContainer(msgs); | ||
156 | if (newType != null) | ||
157 | msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, | ||
158 | msgs); | ||
159 | msgs = basicSetType(newType, msgs); | ||
160 | if (msgs != null) | ||
161 | msgs.dispatch(); | ||
162 | } else if (eNotificationRequired()) | ||
163 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_INSTANCE__TYPE, newType, newType)); | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * <!-- begin-user-doc --> | ||
168 | * <!-- end-user-doc --> | ||
169 | * @generated | ||
170 | */ | ||
171 | @Override | ||
172 | public int getAvailableMemory() { | ||
173 | return (Integer) AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
174 | } | ||
175 | |||
176 | /** | ||
177 | * <!-- begin-user-doc --> | ||
178 | * <!-- end-user-doc --> | ||
179 | * @generated | ||
180 | */ | ||
181 | @Override | ||
182 | public int getAvailableHdd() { | ||
183 | return (Integer) AVAILABLE_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * <!-- begin-user-doc --> | ||
188 | * <!-- end-user-doc --> | ||
189 | * @generated | ||
190 | */ | ||
191 | @Override | ||
192 | public int getTotalMemory() { | ||
193 | return (Integer) TOTAL_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <!-- begin-user-doc --> | ||
198 | * <!-- end-user-doc --> | ||
199 | * @generated | ||
200 | */ | ||
201 | @Override | ||
202 | public int getTotalHdd() { | ||
203 | return (Integer) TOTAL_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * <!-- begin-user-doc --> | ||
208 | * <!-- end-user-doc --> | ||
209 | * @generated | ||
210 | */ | ||
211 | @Override | ||
212 | public EList<ApplicationInstance> getApplications() { | ||
213 | if (applications == null) { | ||
214 | applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this, | ||
215 | CpsPackage.HOST_INSTANCE__APPLICATIONS, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO); | ||
216 | } | ||
217 | return applications; | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @SuppressWarnings("unchecked") | ||
226 | @Override | ||
227 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
228 | switch (featureID) { | ||
229 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
230 | if (eInternalContainer() != null) | ||
231 | msgs = eBasicRemoveFromContainer(msgs); | ||
232 | return basicSetType((HostType) otherEnd, msgs); | ||
233 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
234 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getApplications()).basicAdd(otherEnd, msgs); | ||
235 | } | ||
236 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * <!-- begin-user-doc --> | ||
241 | * <!-- end-user-doc --> | ||
242 | * @generated | ||
243 | */ | ||
244 | @Override | ||
245 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
246 | switch (featureID) { | ||
247 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
248 | return basicSetType(null, msgs); | ||
249 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
250 | return ((InternalEList<?>) getApplications()).basicRemove(otherEnd, msgs); | ||
251 | } | ||
252 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
253 | } | ||
254 | |||
255 | /** | ||
256 | * <!-- begin-user-doc --> | ||
257 | * <!-- end-user-doc --> | ||
258 | * @generated | ||
259 | */ | ||
260 | @Override | ||
261 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
262 | switch (eContainerFeatureID()) { | ||
263 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
264 | return eInternalContainer().eInverseRemove(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, msgs); | ||
265 | } | ||
266 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
267 | } | ||
268 | |||
269 | /** | ||
270 | * <!-- begin-user-doc --> | ||
271 | * <!-- end-user-doc --> | ||
272 | * @generated | ||
273 | */ | ||
274 | @Override | ||
275 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
276 | switch (featureID) { | ||
277 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
278 | return getType(); | ||
279 | case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY: | ||
280 | return getAvailableMemory(); | ||
281 | case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD: | ||
282 | return getAvailableHdd(); | ||
283 | case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY: | ||
284 | return getTotalMemory(); | ||
285 | case CpsPackage.HOST_INSTANCE__TOTAL_HDD: | ||
286 | return getTotalHdd(); | ||
287 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
288 | return getApplications(); | ||
289 | } | ||
290 | return super.eGet(featureID, resolve, coreType); | ||
291 | } | ||
292 | |||
293 | /** | ||
294 | * <!-- begin-user-doc --> | ||
295 | * <!-- end-user-doc --> | ||
296 | * @generated | ||
297 | */ | ||
298 | @SuppressWarnings("unchecked") | ||
299 | @Override | ||
300 | public void eSet(int featureID, Object newValue) { | ||
301 | switch (featureID) { | ||
302 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
303 | setType((HostType) newValue); | ||
304 | return; | ||
305 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
306 | getApplications().clear(); | ||
307 | getApplications().addAll((Collection<? extends ApplicationInstance>) newValue); | ||
308 | return; | ||
309 | } | ||
310 | super.eSet(featureID, newValue); | ||
311 | } | ||
312 | |||
313 | /** | ||
314 | * <!-- begin-user-doc --> | ||
315 | * <!-- end-user-doc --> | ||
316 | * @generated | ||
317 | */ | ||
318 | @Override | ||
319 | public void eUnset(int featureID) { | ||
320 | switch (featureID) { | ||
321 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
322 | setType((HostType) null); | ||
323 | return; | ||
324 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
325 | getApplications().clear(); | ||
326 | return; | ||
327 | } | ||
328 | super.eUnset(featureID); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * <!-- begin-user-doc --> | ||
333 | * <!-- end-user-doc --> | ||
334 | * @generated | ||
335 | */ | ||
336 | @Override | ||
337 | public boolean eIsSet(int featureID) { | ||
338 | switch (featureID) { | ||
339 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
340 | return getType() != null; | ||
341 | case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY: | ||
342 | return AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
343 | case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD: | ||
344 | return AVAILABLE_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
345 | case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY: | ||
346 | return TOTAL_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
347 | case CpsPackage.HOST_INSTANCE__TOTAL_HDD: | ||
348 | return TOTAL_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
349 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
350 | return applications != null && !applications.isEmpty(); | ||
351 | } | ||
352 | return super.eIsSet(featureID); | ||
353 | } | ||
354 | |||
355 | } //HostInstanceImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java new file mode 100644 index 00000000..c3d5b3dc --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java | |||
@@ -0,0 +1,356 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.Notification; | ||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.common.util.EList; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EClass; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
20 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
21 | |||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
23 | import org.eclipse.emf.ecore.util.InternalEList; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Host Type</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultMemory <em>Default Memory</em>}</li> | ||
34 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultHdd <em>Default Hdd</em>}</li> | ||
35 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getInstances <em>Instances</em>}</li> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getCost <em>Cost</em>}</li> | ||
37 | * </ul> | ||
38 | * | ||
39 | * @generated | ||
40 | */ | ||
41 | public class HostTypeImpl extends MinimalEObjectImpl.Container implements HostType { | ||
42 | /** | ||
43 | * The default value of the '{@link #getDefaultMemory() <em>Default Memory</em>}' attribute. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getDefaultMemory() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected static final int DEFAULT_MEMORY_EDEFAULT = 0; | ||
51 | |||
52 | /** | ||
53 | * The cached value of the '{@link #getDefaultMemory() <em>Default Memory</em>}' attribute. | ||
54 | * <!-- begin-user-doc --> | ||
55 | * <!-- end-user-doc --> | ||
56 | * @see #getDefaultMemory() | ||
57 | * @generated | ||
58 | * @ordered | ||
59 | */ | ||
60 | protected int defaultMemory = DEFAULT_MEMORY_EDEFAULT; | ||
61 | |||
62 | /** | ||
63 | * The default value of the '{@link #getDefaultHdd() <em>Default Hdd</em>}' attribute. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @see #getDefaultHdd() | ||
67 | * @generated | ||
68 | * @ordered | ||
69 | */ | ||
70 | protected static final int DEFAULT_HDD_EDEFAULT = 0; | ||
71 | |||
72 | /** | ||
73 | * The cached value of the '{@link #getDefaultHdd() <em>Default Hdd</em>}' attribute. | ||
74 | * <!-- begin-user-doc --> | ||
75 | * <!-- end-user-doc --> | ||
76 | * @see #getDefaultHdd() | ||
77 | * @generated | ||
78 | * @ordered | ||
79 | */ | ||
80 | protected int defaultHdd = DEFAULT_HDD_EDEFAULT; | ||
81 | |||
82 | /** | ||
83 | * The cached value of the '{@link #getInstances() <em>Instances</em>}' containment reference list. | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @see #getInstances() | ||
87 | * @generated | ||
88 | * @ordered | ||
89 | */ | ||
90 | protected EList<HostInstance> instances; | ||
91 | |||
92 | /** | ||
93 | * The default value of the '{@link #getCost() <em>Cost</em>}' attribute. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @see #getCost() | ||
97 | * @generated | ||
98 | * @ordered | ||
99 | */ | ||
100 | protected static final int COST_EDEFAULT = 0; | ||
101 | |||
102 | /** | ||
103 | * The cached value of the '{@link #getCost() <em>Cost</em>}' attribute. | ||
104 | * <!-- begin-user-doc --> | ||
105 | * <!-- end-user-doc --> | ||
106 | * @see #getCost() | ||
107 | * @generated | ||
108 | * @ordered | ||
109 | */ | ||
110 | protected int cost = COST_EDEFAULT; | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | protected HostTypeImpl() { | ||
118 | super(); | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * <!-- begin-user-doc --> | ||
123 | * <!-- end-user-doc --> | ||
124 | * @generated | ||
125 | */ | ||
126 | @Override | ||
127 | protected EClass eStaticClass() { | ||
128 | return CpsPackage.Literals.HOST_TYPE; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @Override | ||
137 | public int getDefaultMemory() { | ||
138 | return defaultMemory; | ||
139 | } | ||
140 | |||
141 | /** | ||
142 | * <!-- begin-user-doc --> | ||
143 | * <!-- end-user-doc --> | ||
144 | * @generated | ||
145 | */ | ||
146 | @Override | ||
147 | public void setDefaultMemory(int newDefaultMemory) { | ||
148 | int oldDefaultMemory = defaultMemory; | ||
149 | defaultMemory = newDefaultMemory; | ||
150 | if (eNotificationRequired()) | ||
151 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_MEMORY, | ||
152 | oldDefaultMemory, defaultMemory)); | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * <!-- begin-user-doc --> | ||
157 | * <!-- end-user-doc --> | ||
158 | * @generated | ||
159 | */ | ||
160 | @Override | ||
161 | public int getDefaultHdd() { | ||
162 | return defaultHdd; | ||
163 | } | ||
164 | |||
165 | /** | ||
166 | * <!-- begin-user-doc --> | ||
167 | * <!-- end-user-doc --> | ||
168 | * @generated | ||
169 | */ | ||
170 | @Override | ||
171 | public void setDefaultHdd(int newDefaultHdd) { | ||
172 | int oldDefaultHdd = defaultHdd; | ||
173 | defaultHdd = newDefaultHdd; | ||
174 | if (eNotificationRequired()) | ||
175 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_HDD, oldDefaultHdd, | ||
176 | defaultHdd)); | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * <!-- begin-user-doc --> | ||
181 | * <!-- end-user-doc --> | ||
182 | * @generated | ||
183 | */ | ||
184 | @Override | ||
185 | public EList<HostInstance> getInstances() { | ||
186 | if (instances == null) { | ||
187 | instances = new EObjectContainmentWithInverseEList<HostInstance>(HostInstance.class, this, | ||
188 | CpsPackage.HOST_TYPE__INSTANCES, CpsPackage.HOST_INSTANCE__TYPE); | ||
189 | } | ||
190 | return instances; | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | @Override | ||
199 | public int getCost() { | ||
200 | return cost; | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * <!-- begin-user-doc --> | ||
205 | * <!-- end-user-doc --> | ||
206 | * @generated | ||
207 | */ | ||
208 | @Override | ||
209 | public void setCost(int newCost) { | ||
210 | int oldCost = cost; | ||
211 | cost = newCost; | ||
212 | if (eNotificationRequired()) | ||
213 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__COST, oldCost, cost)); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | */ | ||
221 | @SuppressWarnings("unchecked") | ||
222 | @Override | ||
223 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
224 | switch (featureID) { | ||
225 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
226 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs); | ||
227 | } | ||
228 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * <!-- begin-user-doc --> | ||
233 | * <!-- end-user-doc --> | ||
234 | * @generated | ||
235 | */ | ||
236 | @Override | ||
237 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
238 | switch (featureID) { | ||
239 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
240 | return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs); | ||
241 | } | ||
242 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
243 | } | ||
244 | |||
245 | /** | ||
246 | * <!-- begin-user-doc --> | ||
247 | * <!-- end-user-doc --> | ||
248 | * @generated | ||
249 | */ | ||
250 | @Override | ||
251 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
252 | switch (featureID) { | ||
253 | case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: | ||
254 | return getDefaultMemory(); | ||
255 | case CpsPackage.HOST_TYPE__DEFAULT_HDD: | ||
256 | return getDefaultHdd(); | ||
257 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
258 | return getInstances(); | ||
259 | case CpsPackage.HOST_TYPE__COST: | ||
260 | return getCost(); | ||
261 | } | ||
262 | return super.eGet(featureID, resolve, coreType); | ||
263 | } | ||
264 | |||
265 | /** | ||
266 | * <!-- begin-user-doc --> | ||
267 | * <!-- end-user-doc --> | ||
268 | * @generated | ||
269 | */ | ||
270 | @SuppressWarnings("unchecked") | ||
271 | @Override | ||
272 | public void eSet(int featureID, Object newValue) { | ||
273 | switch (featureID) { | ||
274 | case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: | ||
275 | setDefaultMemory((Integer) newValue); | ||
276 | return; | ||
277 | case CpsPackage.HOST_TYPE__DEFAULT_HDD: | ||
278 | setDefaultHdd((Integer) newValue); | ||
279 | return; | ||
280 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
281 | getInstances().clear(); | ||
282 | getInstances().addAll((Collection<? extends HostInstance>) newValue); | ||
283 | return; | ||
284 | case CpsPackage.HOST_TYPE__COST: | ||
285 | setCost((Integer) newValue); | ||
286 | return; | ||
287 | } | ||
288 | super.eSet(featureID, newValue); | ||
289 | } | ||
290 | |||
291 | /** | ||
292 | * <!-- begin-user-doc --> | ||
293 | * <!-- end-user-doc --> | ||
294 | * @generated | ||
295 | */ | ||
296 | @Override | ||
297 | public void eUnset(int featureID) { | ||
298 | switch (featureID) { | ||
299 | case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: | ||
300 | setDefaultMemory(DEFAULT_MEMORY_EDEFAULT); | ||
301 | return; | ||
302 | case CpsPackage.HOST_TYPE__DEFAULT_HDD: | ||
303 | setDefaultHdd(DEFAULT_HDD_EDEFAULT); | ||
304 | return; | ||
305 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
306 | getInstances().clear(); | ||
307 | return; | ||
308 | case CpsPackage.HOST_TYPE__COST: | ||
309 | setCost(COST_EDEFAULT); | ||
310 | return; | ||
311 | } | ||
312 | super.eUnset(featureID); | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * <!-- begin-user-doc --> | ||
317 | * <!-- end-user-doc --> | ||
318 | * @generated | ||
319 | */ | ||
320 | @Override | ||
321 | public boolean eIsSet(int featureID) { | ||
322 | switch (featureID) { | ||
323 | case CpsPackage.HOST_TYPE__DEFAULT_MEMORY: | ||
324 | return defaultMemory != DEFAULT_MEMORY_EDEFAULT; | ||
325 | case CpsPackage.HOST_TYPE__DEFAULT_HDD: | ||
326 | return defaultHdd != DEFAULT_HDD_EDEFAULT; | ||
327 | case CpsPackage.HOST_TYPE__INSTANCES: | ||
328 | return instances != null && !instances.isEmpty(); | ||
329 | case CpsPackage.HOST_TYPE__COST: | ||
330 | return cost != COST_EDEFAULT; | ||
331 | } | ||
332 | return super.eIsSet(featureID); | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * <!-- begin-user-doc --> | ||
337 | * <!-- end-user-doc --> | ||
338 | * @generated | ||
339 | */ | ||
340 | @Override | ||
341 | public String toString() { | ||
342 | if (eIsProxy()) | ||
343 | return super.toString(); | ||
344 | |||
345 | StringBuilder result = new StringBuilder(super.toString()); | ||
346 | result.append(" (defaultMemory: "); | ||
347 | result.append(defaultMemory); | ||
348 | result.append(", defaultHdd: "); | ||
349 | result.append(defaultHdd); | ||
350 | result.append(", cost: "); | ||
351 | result.append(cost); | ||
352 | result.append(')'); | ||
353 | return result.toString(); | ||
354 | } | ||
355 | |||
356 | } //HostTypeImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java new file mode 100644 index 00000000..72b4c732 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java | |||
@@ -0,0 +1,169 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.NotificationChain; | ||
12 | |||
13 | import org.eclipse.emf.common.util.EList; | ||
14 | |||
15 | import org.eclipse.emf.ecore.EClass; | ||
16 | import org.eclipse.emf.ecore.InternalEObject; | ||
17 | |||
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
19 | |||
20 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
21 | import org.eclipse.emf.ecore.util.InternalEList; | ||
22 | |||
23 | /** | ||
24 | * <!-- begin-user-doc --> | ||
25 | * An implementation of the model object '<em><b>Request</b></em>'. | ||
26 | * <!-- end-user-doc --> | ||
27 | * <p> | ||
28 | * The following features are implemented: | ||
29 | * </p> | ||
30 | * <ul> | ||
31 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl#getRequirements <em>Requirements</em>}</li> | ||
32 | * </ul> | ||
33 | * | ||
34 | * @generated | ||
35 | */ | ||
36 | public class RequestImpl extends MinimalEObjectImpl.Container implements Request { | ||
37 | /** | ||
38 | * The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference list. | ||
39 | * <!-- begin-user-doc --> | ||
40 | * <!-- end-user-doc --> | ||
41 | * @see #getRequirements() | ||
42 | * @generated | ||
43 | * @ordered | ||
44 | */ | ||
45 | protected EList<Requirement> requirements; | ||
46 | |||
47 | /** | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @generated | ||
51 | */ | ||
52 | protected RequestImpl() { | ||
53 | super(); | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @generated | ||
60 | */ | ||
61 | @Override | ||
62 | protected EClass eStaticClass() { | ||
63 | return CpsPackage.Literals.REQUEST; | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | @Override | ||
72 | public EList<Requirement> getRequirements() { | ||
73 | if (requirements == null) { | ||
74 | requirements = new EObjectContainmentWithInverseEList<Requirement>(Requirement.class, this, | ||
75 | CpsPackage.REQUEST__REQUIREMENTS, CpsPackage.REQUIREMENT__REQUEST); | ||
76 | } | ||
77 | return requirements; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | @SuppressWarnings("unchecked") | ||
86 | @Override | ||
87 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
88 | switch (featureID) { | ||
89 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
90 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getRequirements()).basicAdd(otherEnd, msgs); | ||
91 | } | ||
92 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
93 | } | ||
94 | |||
95 | /** | ||
96 | * <!-- begin-user-doc --> | ||
97 | * <!-- end-user-doc --> | ||
98 | * @generated | ||
99 | */ | ||
100 | @Override | ||
101 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
102 | switch (featureID) { | ||
103 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
104 | return ((InternalEList<?>) getRequirements()).basicRemove(otherEnd, msgs); | ||
105 | } | ||
106 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
107 | } | ||
108 | |||
109 | /** | ||
110 | * <!-- begin-user-doc --> | ||
111 | * <!-- end-user-doc --> | ||
112 | * @generated | ||
113 | */ | ||
114 | @Override | ||
115 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
116 | switch (featureID) { | ||
117 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
118 | return getRequirements(); | ||
119 | } | ||
120 | return super.eGet(featureID, resolve, coreType); | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | @SuppressWarnings("unchecked") | ||
129 | @Override | ||
130 | public void eSet(int featureID, Object newValue) { | ||
131 | switch (featureID) { | ||
132 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
133 | getRequirements().clear(); | ||
134 | getRequirements().addAll((Collection<? extends Requirement>) newValue); | ||
135 | return; | ||
136 | } | ||
137 | super.eSet(featureID, newValue); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * <!-- begin-user-doc --> | ||
142 | * <!-- end-user-doc --> | ||
143 | * @generated | ||
144 | */ | ||
145 | @Override | ||
146 | public void eUnset(int featureID) { | ||
147 | switch (featureID) { | ||
148 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
149 | getRequirements().clear(); | ||
150 | return; | ||
151 | } | ||
152 | super.eUnset(featureID); | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * <!-- begin-user-doc --> | ||
157 | * <!-- end-user-doc --> | ||
158 | * @generated | ||
159 | */ | ||
160 | @Override | ||
161 | public boolean eIsSet(int featureID) { | ||
162 | switch (featureID) { | ||
163 | case CpsPackage.REQUEST__REQUIREMENTS: | ||
164 | return requirements != null && !requirements.isEmpty(); | ||
165 | } | ||
166 | return super.eIsSet(featureID); | ||
167 | } | ||
168 | |||
169 | } //RequestImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java new file mode 100644 index 00000000..79dc4f62 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java | |||
@@ -0,0 +1,387 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
10 | |||
11 | import java.util.Collection; | ||
12 | |||
13 | import org.eclipse.emf.common.notify.Notification; | ||
14 | import org.eclipse.emf.common.notify.NotificationChain; | ||
15 | |||
16 | import org.eclipse.emf.common.util.EList; | ||
17 | |||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.emf.ecore.InternalEObject; | ||
20 | |||
21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
22 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
23 | |||
24 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
25 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
26 | import org.eclipse.emf.ecore.util.InternalEList; | ||
27 | |||
28 | /** | ||
29 | * <!-- begin-user-doc --> | ||
30 | * An implementation of the model object '<em><b>Requirement</b></em>'. | ||
31 | * <!-- end-user-doc --> | ||
32 | * <p> | ||
33 | * The following features are implemented: | ||
34 | * </p> | ||
35 | * <ul> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getRequest <em>Request</em>}</li> | ||
37 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getCount <em>Count</em>}</li> | ||
38 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getType <em>Type</em>}</li> | ||
39 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getInstances <em>Instances</em>}</li> | ||
40 | * </ul> | ||
41 | * | ||
42 | * @generated | ||
43 | */ | ||
44 | public class RequirementImpl extends MinimalEObjectImpl.Container implements Requirement { | ||
45 | /** | ||
46 | * The default value of the '{@link #getCount() <em>Count</em>}' attribute. | ||
47 | * <!-- begin-user-doc --> | ||
48 | * <!-- end-user-doc --> | ||
49 | * @see #getCount() | ||
50 | * @generated | ||
51 | * @ordered | ||
52 | */ | ||
53 | protected static final int COUNT_EDEFAULT = 0; | ||
54 | |||
55 | /** | ||
56 | * The cached value of the '{@link #getCount() <em>Count</em>}' attribute. | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @see #getCount() | ||
60 | * @generated | ||
61 | * @ordered | ||
62 | */ | ||
63 | protected int count = COUNT_EDEFAULT; | ||
64 | |||
65 | /** | ||
66 | * The cached value of the '{@link #getType() <em>Type</em>}' reference. | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @see #getType() | ||
70 | * @generated | ||
71 | * @ordered | ||
72 | */ | ||
73 | protected ApplicationType type; | ||
74 | |||
75 | /** | ||
76 | * The cached value of the '{@link #getInstances() <em>Instances</em>}' reference list. | ||
77 | * <!-- begin-user-doc --> | ||
78 | * <!-- end-user-doc --> | ||
79 | * @see #getInstances() | ||
80 | * @generated | ||
81 | * @ordered | ||
82 | */ | ||
83 | protected EList<ApplicationInstance> instances; | ||
84 | |||
85 | /** | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | protected RequirementImpl() { | ||
91 | super(); | ||
92 | } | ||
93 | |||
94 | /** | ||
95 | * <!-- begin-user-doc --> | ||
96 | * <!-- end-user-doc --> | ||
97 | * @generated | ||
98 | */ | ||
99 | @Override | ||
100 | protected EClass eStaticClass() { | ||
101 | return CpsPackage.Literals.REQUIREMENT; | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | @Override | ||
110 | public Request getRequest() { | ||
111 | if (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST) | ||
112 | return null; | ||
113 | return (Request) eInternalContainer(); | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * <!-- begin-user-doc --> | ||
118 | * <!-- end-user-doc --> | ||
119 | * @generated | ||
120 | */ | ||
121 | public NotificationChain basicSetRequest(Request newRequest, NotificationChain msgs) { | ||
122 | msgs = eBasicSetContainer((InternalEObject) newRequest, CpsPackage.REQUIREMENT__REQUEST, msgs); | ||
123 | return msgs; | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | @Override | ||
132 | public void setRequest(Request newRequest) { | ||
133 | if (newRequest != eInternalContainer() | ||
134 | || (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST && newRequest != null)) { | ||
135 | if (EcoreUtil.isAncestor(this, newRequest)) | ||
136 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
137 | NotificationChain msgs = null; | ||
138 | if (eInternalContainer() != null) | ||
139 | msgs = eBasicRemoveFromContainer(msgs); | ||
140 | if (newRequest != null) | ||
141 | msgs = ((InternalEObject) newRequest).eInverseAdd(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class, | ||
142 | msgs); | ||
143 | msgs = basicSetRequest(newRequest, msgs); | ||
144 | if (msgs != null) | ||
145 | msgs.dispatch(); | ||
146 | } else if (eNotificationRequired()) | ||
147 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__REQUEST, newRequest, | ||
148 | newRequest)); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public int getCount() { | ||
158 | return count; | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | */ | ||
166 | @Override | ||
167 | public void setCount(int newCount) { | ||
168 | int oldCount = count; | ||
169 | count = newCount; | ||
170 | if (eNotificationRequired()) | ||
171 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__COUNT, oldCount, count)); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * <!-- begin-user-doc --> | ||
176 | * <!-- end-user-doc --> | ||
177 | * @generated | ||
178 | */ | ||
179 | @Override | ||
180 | public ApplicationType getType() { | ||
181 | if (type != null && type.eIsProxy()) { | ||
182 | InternalEObject oldType = (InternalEObject) type; | ||
183 | type = (ApplicationType) eResolveProxy(oldType); | ||
184 | if (type != oldType) { | ||
185 | if (eNotificationRequired()) | ||
186 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, CpsPackage.REQUIREMENT__TYPE, oldType, | ||
187 | type)); | ||
188 | } | ||
189 | } | ||
190 | return type; | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | public ApplicationType basicGetType() { | ||
199 | return type; | ||
200 | } | ||
201 | |||
202 | /** | ||
203 | * <!-- begin-user-doc --> | ||
204 | * <!-- end-user-doc --> | ||
205 | * @generated | ||
206 | */ | ||
207 | @Override | ||
208 | public void setType(ApplicationType newType) { | ||
209 | ApplicationType oldType = type; | ||
210 | type = newType; | ||
211 | if (eNotificationRequired()) | ||
212 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__TYPE, oldType, type)); | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * <!-- begin-user-doc --> | ||
217 | * <!-- end-user-doc --> | ||
218 | * @generated | ||
219 | */ | ||
220 | @Override | ||
221 | public EList<ApplicationInstance> getInstances() { | ||
222 | if (instances == null) { | ||
223 | instances = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this, | ||
224 | CpsPackage.REQUIREMENT__INSTANCES, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT); | ||
225 | } | ||
226 | return instances; | ||
227 | } | ||
228 | |||
229 | /** | ||
230 | * <!-- begin-user-doc --> | ||
231 | * <!-- end-user-doc --> | ||
232 | * @generated | ||
233 | */ | ||
234 | @SuppressWarnings("unchecked") | ||
235 | @Override | ||
236 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
237 | switch (featureID) { | ||
238 | case CpsPackage.REQUIREMENT__REQUEST: | ||
239 | if (eInternalContainer() != null) | ||
240 | msgs = eBasicRemoveFromContainer(msgs); | ||
241 | return basicSetRequest((Request) otherEnd, msgs); | ||
242 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
243 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs); | ||
244 | } | ||
245 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
246 | } | ||
247 | |||
248 | /** | ||
249 | * <!-- begin-user-doc --> | ||
250 | * <!-- end-user-doc --> | ||
251 | * @generated | ||
252 | */ | ||
253 | @Override | ||
254 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
255 | switch (featureID) { | ||
256 | case CpsPackage.REQUIREMENT__REQUEST: | ||
257 | return basicSetRequest(null, msgs); | ||
258 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
259 | return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs); | ||
260 | } | ||
261 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <!-- begin-user-doc --> | ||
266 | * <!-- end-user-doc --> | ||
267 | * @generated | ||
268 | */ | ||
269 | @Override | ||
270 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
271 | switch (eContainerFeatureID()) { | ||
272 | case CpsPackage.REQUIREMENT__REQUEST: | ||
273 | return eInternalContainer().eInverseRemove(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class, msgs); | ||
274 | } | ||
275 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
276 | } | ||
277 | |||
278 | /** | ||
279 | * <!-- begin-user-doc --> | ||
280 | * <!-- end-user-doc --> | ||
281 | * @generated | ||
282 | */ | ||
283 | @Override | ||
284 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
285 | switch (featureID) { | ||
286 | case CpsPackage.REQUIREMENT__REQUEST: | ||
287 | return getRequest(); | ||
288 | case CpsPackage.REQUIREMENT__COUNT: | ||
289 | return getCount(); | ||
290 | case CpsPackage.REQUIREMENT__TYPE: | ||
291 | if (resolve) | ||
292 | return getType(); | ||
293 | return basicGetType(); | ||
294 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
295 | return getInstances(); | ||
296 | } | ||
297 | return super.eGet(featureID, resolve, coreType); | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * <!-- begin-user-doc --> | ||
302 | * <!-- end-user-doc --> | ||
303 | * @generated | ||
304 | */ | ||
305 | @SuppressWarnings("unchecked") | ||
306 | @Override | ||
307 | public void eSet(int featureID, Object newValue) { | ||
308 | switch (featureID) { | ||
309 | case CpsPackage.REQUIREMENT__REQUEST: | ||
310 | setRequest((Request) newValue); | ||
311 | return; | ||
312 | case CpsPackage.REQUIREMENT__COUNT: | ||
313 | setCount((Integer) newValue); | ||
314 | return; | ||
315 | case CpsPackage.REQUIREMENT__TYPE: | ||
316 | setType((ApplicationType) newValue); | ||
317 | return; | ||
318 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
319 | getInstances().clear(); | ||
320 | getInstances().addAll((Collection<? extends ApplicationInstance>) newValue); | ||
321 | return; | ||
322 | } | ||
323 | super.eSet(featureID, newValue); | ||
324 | } | ||
325 | |||
326 | /** | ||
327 | * <!-- begin-user-doc --> | ||
328 | * <!-- end-user-doc --> | ||
329 | * @generated | ||
330 | */ | ||
331 | @Override | ||
332 | public void eUnset(int featureID) { | ||
333 | switch (featureID) { | ||
334 | case CpsPackage.REQUIREMENT__REQUEST: | ||
335 | setRequest((Request) null); | ||
336 | return; | ||
337 | case CpsPackage.REQUIREMENT__COUNT: | ||
338 | setCount(COUNT_EDEFAULT); | ||
339 | return; | ||
340 | case CpsPackage.REQUIREMENT__TYPE: | ||
341 | setType((ApplicationType) null); | ||
342 | return; | ||
343 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
344 | getInstances().clear(); | ||
345 | return; | ||
346 | } | ||
347 | super.eUnset(featureID); | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * <!-- begin-user-doc --> | ||
352 | * <!-- end-user-doc --> | ||
353 | * @generated | ||
354 | */ | ||
355 | @Override | ||
356 | public boolean eIsSet(int featureID) { | ||
357 | switch (featureID) { | ||
358 | case CpsPackage.REQUIREMENT__REQUEST: | ||
359 | return getRequest() != null; | ||
360 | case CpsPackage.REQUIREMENT__COUNT: | ||
361 | return count != COUNT_EDEFAULT; | ||
362 | case CpsPackage.REQUIREMENT__TYPE: | ||
363 | return type != null; | ||
364 | case CpsPackage.REQUIREMENT__INSTANCES: | ||
365 | return instances != null && !instances.isEmpty(); | ||
366 | } | ||
367 | return super.eIsSet(featureID); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * <!-- begin-user-doc --> | ||
372 | * <!-- end-user-doc --> | ||
373 | * @generated | ||
374 | */ | ||
375 | @Override | ||
376 | public String toString() { | ||
377 | if (eIsProxy()) | ||
378 | return super.toString(); | ||
379 | |||
380 | StringBuilder result = new StringBuilder(super.toString()); | ||
381 | result.append(" (count: "); | ||
382 | result.append(count); | ||
383 | result.append(')'); | ||
384 | return result.toString(); | ||
385 | } | ||
386 | |||
387 | } //RequirementImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java new file mode 100644 index 00000000..f4deb575 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java | |||
@@ -0,0 +1,291 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
8 | |||
9 | import org.eclipse.emf.common.notify.Notification; | ||
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>Resource Requirement</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredMemory <em>Required Memory</em>}</li> | ||
26 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredHdd <em>Required Hdd</em>}</li> | ||
27 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getHostType <em>Host Type</em>}</li> | ||
28 | * </ul> | ||
29 | * | ||
30 | * @generated | ||
31 | */ | ||
32 | public class ResourceRequirementImpl extends MinimalEObjectImpl.Container implements ResourceRequirement { | ||
33 | /** | ||
34 | * The default value of the '{@link #getRequiredMemory() <em>Required Memory</em>}' attribute. | ||
35 | * <!-- begin-user-doc --> | ||
36 | * <!-- end-user-doc --> | ||
37 | * @see #getRequiredMemory() | ||
38 | * @generated | ||
39 | * @ordered | ||
40 | */ | ||
41 | protected static final int REQUIRED_MEMORY_EDEFAULT = 0; | ||
42 | |||
43 | /** | ||
44 | * The cached value of the '{@link #getRequiredMemory() <em>Required Memory</em>}' attribute. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <!-- end-user-doc --> | ||
47 | * @see #getRequiredMemory() | ||
48 | * @generated | ||
49 | * @ordered | ||
50 | */ | ||
51 | protected int requiredMemory = REQUIRED_MEMORY_EDEFAULT; | ||
52 | |||
53 | /** | ||
54 | * The default value of the '{@link #getRequiredHdd() <em>Required Hdd</em>}' attribute. | ||
55 | * <!-- begin-user-doc --> | ||
56 | * <!-- end-user-doc --> | ||
57 | * @see #getRequiredHdd() | ||
58 | * @generated | ||
59 | * @ordered | ||
60 | */ | ||
61 | protected static final int REQUIRED_HDD_EDEFAULT = 0; | ||
62 | |||
63 | /** | ||
64 | * The cached value of the '{@link #getRequiredHdd() <em>Required Hdd</em>}' attribute. | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @see #getRequiredHdd() | ||
68 | * @generated | ||
69 | * @ordered | ||
70 | */ | ||
71 | protected int requiredHdd = REQUIRED_HDD_EDEFAULT; | ||
72 | |||
73 | /** | ||
74 | * The cached value of the '{@link #getHostType() <em>Host Type</em>}' reference. | ||
75 | * <!-- begin-user-doc --> | ||
76 | * <!-- end-user-doc --> | ||
77 | * @see #getHostType() | ||
78 | * @generated | ||
79 | * @ordered | ||
80 | */ | ||
81 | protected HostType hostType; | ||
82 | |||
83 | /** | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @generated | ||
87 | */ | ||
88 | protected ResourceRequirementImpl() { | ||
89 | super(); | ||
90 | } | ||
91 | |||
92 | /** | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @generated | ||
96 | */ | ||
97 | @Override | ||
98 | protected EClass eStaticClass() { | ||
99 | return CpsPackage.Literals.RESOURCE_REQUIREMENT; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * <!-- begin-user-doc --> | ||
104 | * <!-- end-user-doc --> | ||
105 | * @generated | ||
106 | */ | ||
107 | @Override | ||
108 | public int getRequiredMemory() { | ||
109 | return requiredMemory; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public void setRequiredMemory(int newRequiredMemory) { | ||
119 | int oldRequiredMemory = requiredMemory; | ||
120 | requiredMemory = newRequiredMemory; | ||
121 | if (eNotificationRequired()) | ||
122 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY, | ||
123 | oldRequiredMemory, requiredMemory)); | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | @Override | ||
132 | public int getRequiredHdd() { | ||
133 | return requiredHdd; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * <!-- begin-user-doc --> | ||
138 | * <!-- end-user-doc --> | ||
139 | * @generated | ||
140 | */ | ||
141 | @Override | ||
142 | public void setRequiredHdd(int newRequiredHdd) { | ||
143 | int oldRequiredHdd = requiredHdd; | ||
144 | requiredHdd = newRequiredHdd; | ||
145 | if (eNotificationRequired()) | ||
146 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD, | ||
147 | oldRequiredHdd, requiredHdd)); | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * <!-- begin-user-doc --> | ||
152 | * <!-- end-user-doc --> | ||
153 | * @generated | ||
154 | */ | ||
155 | @Override | ||
156 | public HostType getHostType() { | ||
157 | if (hostType != null && hostType.eIsProxy()) { | ||
158 | InternalEObject oldHostType = (InternalEObject) hostType; | ||
159 | hostType = (HostType) eResolveProxy(oldHostType); | ||
160 | if (hostType != oldHostType) { | ||
161 | if (eNotificationRequired()) | ||
162 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, | ||
163 | CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE, oldHostType, hostType)); | ||
164 | } | ||
165 | } | ||
166 | return hostType; | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * <!-- begin-user-doc --> | ||
171 | * <!-- end-user-doc --> | ||
172 | * @generated | ||
173 | */ | ||
174 | public HostType basicGetHostType() { | ||
175 | return hostType; | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | @Override | ||
184 | public void setHostType(HostType newHostType) { | ||
185 | HostType oldHostType = hostType; | ||
186 | hostType = newHostType; | ||
187 | if (eNotificationRequired()) | ||
188 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE, | ||
189 | oldHostType, hostType)); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * <!-- begin-user-doc --> | ||
194 | * <!-- end-user-doc --> | ||
195 | * @generated | ||
196 | */ | ||
197 | @Override | ||
198 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
199 | switch (featureID) { | ||
200 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: | ||
201 | return getRequiredMemory(); | ||
202 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: | ||
203 | return getRequiredHdd(); | ||
204 | case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: | ||
205 | if (resolve) | ||
206 | return getHostType(); | ||
207 | return basicGetHostType(); | ||
208 | } | ||
209 | return super.eGet(featureID, resolve, coreType); | ||
210 | } | ||
211 | |||
212 | /** | ||
213 | * <!-- begin-user-doc --> | ||
214 | * <!-- end-user-doc --> | ||
215 | * @generated | ||
216 | */ | ||
217 | @Override | ||
218 | public void eSet(int featureID, Object newValue) { | ||
219 | switch (featureID) { | ||
220 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: | ||
221 | setRequiredMemory((Integer) newValue); | ||
222 | return; | ||
223 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: | ||
224 | setRequiredHdd((Integer) newValue); | ||
225 | return; | ||
226 | case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: | ||
227 | setHostType((HostType) newValue); | ||
228 | return; | ||
229 | } | ||
230 | super.eSet(featureID, newValue); | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * <!-- begin-user-doc --> | ||
235 | * <!-- end-user-doc --> | ||
236 | * @generated | ||
237 | */ | ||
238 | @Override | ||
239 | public void eUnset(int featureID) { | ||
240 | switch (featureID) { | ||
241 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: | ||
242 | setRequiredMemory(REQUIRED_MEMORY_EDEFAULT); | ||
243 | return; | ||
244 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: | ||
245 | setRequiredHdd(REQUIRED_HDD_EDEFAULT); | ||
246 | return; | ||
247 | case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: | ||
248 | setHostType((HostType) null); | ||
249 | return; | ||
250 | } | ||
251 | super.eUnset(featureID); | ||
252 | } | ||
253 | |||
254 | /** | ||
255 | * <!-- begin-user-doc --> | ||
256 | * <!-- end-user-doc --> | ||
257 | * @generated | ||
258 | */ | ||
259 | @Override | ||
260 | public boolean eIsSet(int featureID) { | ||
261 | switch (featureID) { | ||
262 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY: | ||
263 | return requiredMemory != REQUIRED_MEMORY_EDEFAULT; | ||
264 | case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD: | ||
265 | return requiredHdd != REQUIRED_HDD_EDEFAULT; | ||
266 | case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE: | ||
267 | return hostType != null; | ||
268 | } | ||
269 | return super.eIsSet(featureID); | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * <!-- begin-user-doc --> | ||
274 | * <!-- end-user-doc --> | ||
275 | * @generated | ||
276 | */ | ||
277 | @Override | ||
278 | public String toString() { | ||
279 | if (eIsProxy()) | ||
280 | return super.toString(); | ||
281 | |||
282 | StringBuilder result = new StringBuilder(super.toString()); | ||
283 | result.append(" (requiredMemory: "); | ||
284 | result.append(requiredMemory); | ||
285 | result.append(", requiredHdd: "); | ||
286 | result.append(requiredHdd); | ||
287 | result.append(')'); | ||
288 | return result.toString(); | ||
289 | } | ||
290 | |||
291 | } //ResourceRequirementImpl | ||