aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.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/RequirementImpl.java')
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java387
1 files changed, 387 insertions, 0 deletions
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 */
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.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
9import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
10
11import java.util.Collection;
12
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.common.notify.NotificationChain;
15
16import org.eclipse.emf.common.util.EList;
17
18import org.eclipse.emf.ecore.EClass;
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>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 */
44public 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