diff options
author | 2020-06-25 19:55:10 +0200 | |
---|---|---|
committer | 2020-06-25 19:55:10 +0200 | |
commit | c3a6d4b9cf3657070d180aa65ddbf0459e880329 (patch) | |
tree | 780c4fc61578dcb309af53fb0c164c7627e51676 /Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java | |
parent | New configuration language parser WIP (diff) | |
parent | Scope unsat benchmarks (diff) | |
download | VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.tar.gz VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.tar.zst VIATRA-Generator-c3a6d4b9cf3657070d180aa65ddbf0459e880329.zip |
Merge branch 'kris'
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java | 356 |
1 files changed, 356 insertions, 0 deletions
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 | ||