diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2020-06-25 19:55:10 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 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/HostInstanceImpl.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/HostInstanceImpl.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java | 250 |
1 files changed, 250 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..551f2ed6 --- /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,250 @@ | |||
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.InternalEObject; | ||
19 | |||
20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
21 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
22 | |||
23 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
24 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
25 | import org.eclipse.emf.ecore.util.InternalEList; | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * An implementation of the model object '<em><b>Host Instance</b></em>'. | ||
30 | * <!-- end-user-doc --> | ||
31 | * <p> | ||
32 | * The following features are implemented: | ||
33 | * </p> | ||
34 | * <ul> | ||
35 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li> | ||
37 | * </ul> | ||
38 | * | ||
39 | * @generated | ||
40 | */ | ||
41 | public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance { | ||
42 | /** | ||
43 | * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getApplications() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected EList<ApplicationInstance> applications; | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | protected HostInstanceImpl() { | ||
58 | super(); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected EClass eStaticClass() { | ||
68 | return CpsPackage.Literals.HOST_INSTANCE; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | @Override | ||
77 | public HostType getType() { | ||
78 | if (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE) | ||
79 | return null; | ||
80 | return (HostType) eInternalContainer(); | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @generated | ||
87 | */ | ||
88 | public NotificationChain basicSetType(HostType newType, NotificationChain msgs) { | ||
89 | msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.HOST_INSTANCE__TYPE, msgs); | ||
90 | return msgs; | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public void setType(HostType newType) { | ||
100 | if (newType != eInternalContainer() | ||
101 | || (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE && newType != null)) { | ||
102 | if (EcoreUtil.isAncestor(this, newType)) | ||
103 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
104 | NotificationChain msgs = null; | ||
105 | if (eInternalContainer() != null) | ||
106 | msgs = eBasicRemoveFromContainer(msgs); | ||
107 | if (newType != null) | ||
108 | msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, | ||
109 | msgs); | ||
110 | msgs = basicSetType(newType, msgs); | ||
111 | if (msgs != null) | ||
112 | msgs.dispatch(); | ||
113 | } else if (eNotificationRequired()) | ||
114 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_INSTANCE__TYPE, newType, newType)); | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | */ | ||
122 | @Override | ||
123 | public EList<ApplicationInstance> getApplications() { | ||
124 | if (applications == null) { | ||
125 | applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this, | ||
126 | CpsPackage.HOST_INSTANCE__APPLICATIONS, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO); | ||
127 | } | ||
128 | return applications; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @SuppressWarnings("unchecked") | ||
137 | @Override | ||
138 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
139 | switch (featureID) { | ||
140 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
141 | if (eInternalContainer() != null) | ||
142 | msgs = eBasicRemoveFromContainer(msgs); | ||
143 | return basicSetType((HostType) otherEnd, msgs); | ||
144 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
145 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getApplications()).basicAdd(otherEnd, msgs); | ||
146 | } | ||
147 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * <!-- begin-user-doc --> | ||
152 | * <!-- end-user-doc --> | ||
153 | * @generated | ||
154 | */ | ||
155 | @Override | ||
156 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
157 | switch (featureID) { | ||
158 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
159 | return basicSetType(null, msgs); | ||
160 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
161 | return ((InternalEList<?>) getApplications()).basicRemove(otherEnd, msgs); | ||
162 | } | ||
163 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * <!-- begin-user-doc --> | ||
168 | * <!-- end-user-doc --> | ||
169 | * @generated | ||
170 | */ | ||
171 | @Override | ||
172 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
173 | switch (eContainerFeatureID()) { | ||
174 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
175 | return eInternalContainer().eInverseRemove(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, msgs); | ||
176 | } | ||
177 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @generated | ||
184 | */ | ||
185 | @Override | ||
186 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
187 | switch (featureID) { | ||
188 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
189 | return getType(); | ||
190 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
191 | return getApplications(); | ||
192 | } | ||
193 | return super.eGet(featureID, resolve, coreType); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <!-- begin-user-doc --> | ||
198 | * <!-- end-user-doc --> | ||
199 | * @generated | ||
200 | */ | ||
201 | @SuppressWarnings("unchecked") | ||
202 | @Override | ||
203 | public void eSet(int featureID, Object newValue) { | ||
204 | switch (featureID) { | ||
205 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
206 | setType((HostType) newValue); | ||
207 | return; | ||
208 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
209 | getApplications().clear(); | ||
210 | getApplications().addAll((Collection<? extends ApplicationInstance>) newValue); | ||
211 | return; | ||
212 | } | ||
213 | super.eSet(featureID, newValue); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | */ | ||
221 | @Override | ||
222 | public void eUnset(int featureID) { | ||
223 | switch (featureID) { | ||
224 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
225 | setType((HostType) null); | ||
226 | return; | ||
227 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
228 | getApplications().clear(); | ||
229 | return; | ||
230 | } | ||
231 | super.eUnset(featureID); | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * <!-- begin-user-doc --> | ||
236 | * <!-- end-user-doc --> | ||
237 | * @generated | ||
238 | */ | ||
239 | @Override | ||
240 | public boolean eIsSet(int featureID) { | ||
241 | switch (featureID) { | ||
242 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
243 | return getType() != null; | ||
244 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
245 | return applications != null && !applications.isEmpty(); | ||
246 | } | ||
247 | return super.eIsSet(featureID); | ||
248 | } | ||
249 | |||
250 | } //HostInstanceImpl | ||