aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java')
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java355
1 files changed, 355 insertions, 0 deletions
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 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
9
10import java.util.Collection;
11
12import org.eclipse.emf.common.notify.Notification;
13import org.eclipse.emf.common.notify.NotificationChain;
14
15import org.eclipse.emf.common.util.EList;
16
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.EStructuralFeature;
19import org.eclipse.emf.ecore.InternalEObject;
20
21import org.eclipse.emf.ecore.impl.ENotificationImpl;
22import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
23
24import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
25import org.eclipse.emf.ecore.util.EcoreUtil;
26import 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 */
46public 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