1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.cpdp.decentApp.models.decent.impl;
|
---|
4 |
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.Date;
|
---|
7 |
|
---|
8 | import org.eclipse.emf.common.notify.Notification;
|
---|
9 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
10 | import org.eclipse.emf.common.util.EList;
|
---|
11 | import org.eclipse.emf.ecore.EClass;
|
---|
12 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
13 | import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
---|
14 | import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
---|
15 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
|
---|
16 | import org.eclipse.emf.ecore.util.EObjectResolvingEList;
|
---|
17 | import org.eclipse.emf.ecore.util.EcoreUtil;
|
---|
18 | import org.eclipse.emf.ecore.util.InternalEList;
|
---|
19 |
|
---|
20 | import de.ugoe.cs.cpdp.decentApp.models.decent.Activity;
|
---|
21 | import de.ugoe.cs.cpdp.decentApp.models.decent.ActivityType;
|
---|
22 | import de.ugoe.cs.cpdp.decentApp.models.decent.Agent;
|
---|
23 | import de.ugoe.cs.cpdp.decentApp.models.decent.AgentState;
|
---|
24 | import de.ugoe.cs.cpdp.decentApp.models.decent.DECENTPackage;
|
---|
25 | import de.ugoe.cs.cpdp.decentApp.models.decent.Delta;
|
---|
26 | import de.ugoe.cs.cpdp.decentApp.models.decent.State;
|
---|
27 | import de.ugoe.cs.cpdp.decentApp.models.decent.Value;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * <!-- begin-user-doc -->
|
---|
31 | * An implementation of the model object '<em><b>Activity</b></em>'.
|
---|
32 | * <!-- end-user-doc -->
|
---|
33 | * <p>
|
---|
34 | * The following features are implemented:
|
---|
35 | * <ul>
|
---|
36 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getType <em>Type</em>}</li>
|
---|
37 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getAgent <em>Agent</em>}</li>
|
---|
38 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getState <em>State</em>}</li>
|
---|
39 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getTargetState <em>Target State</em>}</li>
|
---|
40 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getDeltas <em>Deltas</em>}</li>
|
---|
41 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getDate <em>Date</em>}</li>
|
---|
42 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getValues <em>Values</em>}</li>
|
---|
43 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.ActivityImpl#getAgentState <em>Agent State</em>}</li>
|
---|
44 | * </ul>
|
---|
45 | * </p>
|
---|
46 | *
|
---|
47 | * @generated
|
---|
48 | */
|
---|
49 | public class ActivityImpl extends ElementImpl implements Activity {
|
---|
50 | /**
|
---|
51 | * The cached value of the '{@link #getType() <em>Type</em>}' reference list.
|
---|
52 | * <!-- begin-user-doc -->
|
---|
53 | * <!-- end-user-doc -->
|
---|
54 | * @see #getType()
|
---|
55 | * @generated
|
---|
56 | * @ordered
|
---|
57 | */
|
---|
58 | protected EList<ActivityType> type;
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * The cached value of the '{@link #getState() <em>State</em>}' reference.
|
---|
62 | * <!-- begin-user-doc -->
|
---|
63 | * <!-- end-user-doc -->
|
---|
64 | * @see #getState()
|
---|
65 | * @generated
|
---|
66 | * @ordered
|
---|
67 | */
|
---|
68 | protected State state;
|
---|
69 |
|
---|
70 | /**
|
---|
71 | * The cached value of the '{@link #getTargetState() <em>Target State</em>}' reference.
|
---|
72 | * <!-- begin-user-doc -->
|
---|
73 | * <!-- end-user-doc -->
|
---|
74 | * @see #getTargetState()
|
---|
75 | * @generated
|
---|
76 | * @ordered
|
---|
77 | */
|
---|
78 | protected State targetState;
|
---|
79 |
|
---|
80 | /**
|
---|
81 | * The cached value of the '{@link #getDeltas() <em>Deltas</em>}' containment reference list.
|
---|
82 | * <!-- begin-user-doc -->
|
---|
83 | * <!-- end-user-doc -->
|
---|
84 | * @see #getDeltas()
|
---|
85 | * @generated
|
---|
86 | * @ordered
|
---|
87 | */
|
---|
88 | protected EList<Delta> deltas;
|
---|
89 |
|
---|
90 | /**
|
---|
91 | * The default value of the '{@link #getDate() <em>Date</em>}' attribute.
|
---|
92 | * <!-- begin-user-doc -->
|
---|
93 | * <!-- end-user-doc -->
|
---|
94 | * @see #getDate()
|
---|
95 | * @generated
|
---|
96 | * @ordered
|
---|
97 | */
|
---|
98 | protected static final Date DATE_EDEFAULT = null;
|
---|
99 |
|
---|
100 | /**
|
---|
101 | * The cached value of the '{@link #getDate() <em>Date</em>}' attribute.
|
---|
102 | * <!-- begin-user-doc -->
|
---|
103 | * <!-- end-user-doc -->
|
---|
104 | * @see #getDate()
|
---|
105 | * @generated
|
---|
106 | * @ordered
|
---|
107 | */
|
---|
108 | protected Date date = DATE_EDEFAULT;
|
---|
109 |
|
---|
110 | /**
|
---|
111 | * The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list.
|
---|
112 | * <!-- begin-user-doc -->
|
---|
113 | * <!-- end-user-doc -->
|
---|
114 | * @see #getValues()
|
---|
115 | * @generated
|
---|
116 | * @ordered
|
---|
117 | */
|
---|
118 | protected EList<Value> values;
|
---|
119 |
|
---|
120 | /**
|
---|
121 | * The cached value of the '{@link #getAgentState() <em>Agent State</em>}' reference.
|
---|
122 | * <!-- begin-user-doc -->
|
---|
123 | * <!-- end-user-doc -->
|
---|
124 | * @see #getAgentState()
|
---|
125 | * @generated
|
---|
126 | * @ordered
|
---|
127 | */
|
---|
128 | protected AgentState agentState;
|
---|
129 |
|
---|
130 | /**
|
---|
131 | * <!-- begin-user-doc -->
|
---|
132 | * <!-- end-user-doc -->
|
---|
133 | * @generated
|
---|
134 | */
|
---|
135 | protected ActivityImpl() {
|
---|
136 | super();
|
---|
137 | }
|
---|
138 |
|
---|
139 | /**
|
---|
140 | * <!-- begin-user-doc -->
|
---|
141 | * <!-- end-user-doc -->
|
---|
142 | * @generated
|
---|
143 | */
|
---|
144 | @Override
|
---|
145 | protected EClass eStaticClass() {
|
---|
146 | return DECENTPackage.Literals.ACTIVITY;
|
---|
147 | }
|
---|
148 |
|
---|
149 | /**
|
---|
150 | * <!-- begin-user-doc -->
|
---|
151 | * <!-- end-user-doc -->
|
---|
152 | * @generated
|
---|
153 | */
|
---|
154 | public EList<ActivityType> getType() {
|
---|
155 | if (type == null) {
|
---|
156 | type = new EObjectResolvingEList<ActivityType>(ActivityType.class, this, DECENTPackage.ACTIVITY__TYPE);
|
---|
157 | }
|
---|
158 | return type;
|
---|
159 | }
|
---|
160 |
|
---|
161 | /**
|
---|
162 | * <!-- begin-user-doc -->
|
---|
163 | * <!-- end-user-doc -->
|
---|
164 | * @generated
|
---|
165 | */
|
---|
166 | public Agent getAgent() {
|
---|
167 | if (eContainerFeatureID() != DECENTPackage.ACTIVITY__AGENT) return null;
|
---|
168 | return (Agent)eInternalContainer();
|
---|
169 | }
|
---|
170 |
|
---|
171 | /**
|
---|
172 | * <!-- begin-user-doc -->
|
---|
173 | * <!-- end-user-doc -->
|
---|
174 | * @generated
|
---|
175 | */
|
---|
176 | public NotificationChain basicSetAgent(Agent newAgent, NotificationChain msgs) {
|
---|
177 | msgs = eBasicSetContainer((InternalEObject)newAgent, DECENTPackage.ACTIVITY__AGENT, msgs);
|
---|
178 | return msgs;
|
---|
179 | }
|
---|
180 |
|
---|
181 | /**
|
---|
182 | * <!-- begin-user-doc -->
|
---|
183 | * <!-- end-user-doc -->
|
---|
184 | * @generated
|
---|
185 | */
|
---|
186 | public void setAgent(Agent newAgent) {
|
---|
187 | if (newAgent != eInternalContainer() || (eContainerFeatureID() != DECENTPackage.ACTIVITY__AGENT && newAgent != null)) {
|
---|
188 | if (EcoreUtil.isAncestor(this, newAgent))
|
---|
189 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
|
---|
190 | NotificationChain msgs = null;
|
---|
191 | if (eInternalContainer() != null)
|
---|
192 | msgs = eBasicRemoveFromContainer(msgs);
|
---|
193 | if (newAgent != null)
|
---|
194 | msgs = ((InternalEObject)newAgent).eInverseAdd(this, DECENTPackage.AGENT__ACTIVITIES, Agent.class, msgs);
|
---|
195 | msgs = basicSetAgent(newAgent, msgs);
|
---|
196 | if (msgs != null) msgs.dispatch();
|
---|
197 | }
|
---|
198 | else if (eNotificationRequired())
|
---|
199 | eNotify(new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__AGENT, newAgent, newAgent));
|
---|
200 | }
|
---|
201 |
|
---|
202 | /**
|
---|
203 | * <!-- begin-user-doc -->
|
---|
204 | * <!-- end-user-doc -->
|
---|
205 | * @generated
|
---|
206 | */
|
---|
207 | public State getState() {
|
---|
208 | if (state != null && state.eIsProxy()) {
|
---|
209 | InternalEObject oldState = (InternalEObject)state;
|
---|
210 | state = (State)eResolveProxy(oldState);
|
---|
211 | if (state != oldState) {
|
---|
212 | if (eNotificationRequired())
|
---|
213 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, DECENTPackage.ACTIVITY__STATE, oldState, state));
|
---|
214 | }
|
---|
215 | }
|
---|
216 | return state;
|
---|
217 | }
|
---|
218 |
|
---|
219 | /**
|
---|
220 | * <!-- begin-user-doc -->
|
---|
221 | * <!-- end-user-doc -->
|
---|
222 | * @generated
|
---|
223 | */
|
---|
224 | public State basicGetState() {
|
---|
225 | return state;
|
---|
226 | }
|
---|
227 |
|
---|
228 | /**
|
---|
229 | * <!-- begin-user-doc -->
|
---|
230 | * <!-- end-user-doc -->
|
---|
231 | * @generated
|
---|
232 | */
|
---|
233 | public NotificationChain basicSetState(State newState, NotificationChain msgs) {
|
---|
234 | State oldState = state;
|
---|
235 | state = newState;
|
---|
236 | if (eNotificationRequired()) {
|
---|
237 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__STATE, oldState, newState);
|
---|
238 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
239 | }
|
---|
240 | return msgs;
|
---|
241 | }
|
---|
242 |
|
---|
243 | /**
|
---|
244 | * <!-- begin-user-doc -->
|
---|
245 | * <!-- end-user-doc -->
|
---|
246 | * @generated
|
---|
247 | */
|
---|
248 | public void setState(State newState) {
|
---|
249 | if (newState != state) {
|
---|
250 | NotificationChain msgs = null;
|
---|
251 | if (state != null)
|
---|
252 | msgs = ((InternalEObject)state).eInverseRemove(this, DECENTPackage.STATE__ACTIVITY, State.class, msgs);
|
---|
253 | if (newState != null)
|
---|
254 | msgs = ((InternalEObject)newState).eInverseAdd(this, DECENTPackage.STATE__ACTIVITY, State.class, msgs);
|
---|
255 | msgs = basicSetState(newState, msgs);
|
---|
256 | if (msgs != null) msgs.dispatch();
|
---|
257 | }
|
---|
258 | else if (eNotificationRequired())
|
---|
259 | eNotify(new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__STATE, newState, newState));
|
---|
260 | }
|
---|
261 |
|
---|
262 | /**
|
---|
263 | * <!-- begin-user-doc -->
|
---|
264 | * <!-- end-user-doc -->
|
---|
265 | * @generated
|
---|
266 | */
|
---|
267 | public State getTargetState() {
|
---|
268 | if (targetState != null && targetState.eIsProxy()) {
|
---|
269 | InternalEObject oldTargetState = (InternalEObject)targetState;
|
---|
270 | targetState = (State)eResolveProxy(oldTargetState);
|
---|
271 | if (targetState != oldTargetState) {
|
---|
272 | if (eNotificationRequired())
|
---|
273 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, DECENTPackage.ACTIVITY__TARGET_STATE, oldTargetState, targetState));
|
---|
274 | }
|
---|
275 | }
|
---|
276 | return targetState;
|
---|
277 | }
|
---|
278 |
|
---|
279 | /**
|
---|
280 | * <!-- begin-user-doc -->
|
---|
281 | * <!-- end-user-doc -->
|
---|
282 | * @generated
|
---|
283 | */
|
---|
284 | public State basicGetTargetState() {
|
---|
285 | return targetState;
|
---|
286 | }
|
---|
287 |
|
---|
288 | /**
|
---|
289 | * <!-- begin-user-doc -->
|
---|
290 | * <!-- end-user-doc -->
|
---|
291 | * @generated
|
---|
292 | */
|
---|
293 | public NotificationChain basicSetTargetState(State newTargetState, NotificationChain msgs) {
|
---|
294 | State oldTargetState = targetState;
|
---|
295 | targetState = newTargetState;
|
---|
296 | if (eNotificationRequired()) {
|
---|
297 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__TARGET_STATE, oldTargetState, newTargetState);
|
---|
298 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
299 | }
|
---|
300 | return msgs;
|
---|
301 | }
|
---|
302 |
|
---|
303 | /**
|
---|
304 | * <!-- begin-user-doc -->
|
---|
305 | * <!-- end-user-doc -->
|
---|
306 | * @generated
|
---|
307 | */
|
---|
308 | public void setTargetState(State newTargetState) {
|
---|
309 | if (newTargetState != targetState) {
|
---|
310 | NotificationChain msgs = null;
|
---|
311 | if (targetState != null)
|
---|
312 | msgs = ((InternalEObject)targetState).eInverseRemove(this, DECENTPackage.STATE__FROM_ACTIVITY, State.class, msgs);
|
---|
313 | if (newTargetState != null)
|
---|
314 | msgs = ((InternalEObject)newTargetState).eInverseAdd(this, DECENTPackage.STATE__FROM_ACTIVITY, State.class, msgs);
|
---|
315 | msgs = basicSetTargetState(newTargetState, msgs);
|
---|
316 | if (msgs != null) msgs.dispatch();
|
---|
317 | }
|
---|
318 | else if (eNotificationRequired())
|
---|
319 | eNotify(new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__TARGET_STATE, newTargetState, newTargetState));
|
---|
320 | }
|
---|
321 |
|
---|
322 | /**
|
---|
323 | * <!-- begin-user-doc -->
|
---|
324 | * <!-- end-user-doc -->
|
---|
325 | * @generated
|
---|
326 | */
|
---|
327 | public EList<Delta> getDeltas() {
|
---|
328 | if (deltas == null) {
|
---|
329 | deltas = new EObjectContainmentWithInverseEList<Delta>(Delta.class, this, DECENTPackage.ACTIVITY__DELTAS, DECENTPackage.DELTA__ACTIVITY);
|
---|
330 | }
|
---|
331 | return deltas;
|
---|
332 | }
|
---|
333 |
|
---|
334 | /**
|
---|
335 | * <!-- begin-user-doc -->
|
---|
336 | * <!-- end-user-doc -->
|
---|
337 | * @generated
|
---|
338 | */
|
---|
339 | public Date getDate() {
|
---|
340 | return date;
|
---|
341 | }
|
---|
342 |
|
---|
343 | /**
|
---|
344 | * <!-- begin-user-doc -->
|
---|
345 | * <!-- end-user-doc -->
|
---|
346 | * @generated
|
---|
347 | */
|
---|
348 | public void setDate(Date newDate) {
|
---|
349 | Date oldDate = date;
|
---|
350 | date = newDate;
|
---|
351 | if (eNotificationRequired())
|
---|
352 | eNotify(new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__DATE, oldDate, date));
|
---|
353 | }
|
---|
354 |
|
---|
355 | /**
|
---|
356 | * <!-- begin-user-doc -->
|
---|
357 | * <!-- end-user-doc -->
|
---|
358 | * @generated
|
---|
359 | */
|
---|
360 | public EList<Value> getValues() {
|
---|
361 | if (values == null) {
|
---|
362 | values = new EObjectContainmentEList<Value>(Value.class, this, DECENTPackage.ACTIVITY__VALUES);
|
---|
363 | }
|
---|
364 | return values;
|
---|
365 | }
|
---|
366 |
|
---|
367 | /**
|
---|
368 | * <!-- begin-user-doc -->
|
---|
369 | * <!-- end-user-doc -->
|
---|
370 | * @generated
|
---|
371 | */
|
---|
372 | public AgentState getAgentState() {
|
---|
373 | if (agentState != null && agentState.eIsProxy()) {
|
---|
374 | InternalEObject oldAgentState = (InternalEObject)agentState;
|
---|
375 | agentState = (AgentState)eResolveProxy(oldAgentState);
|
---|
376 | if (agentState != oldAgentState) {
|
---|
377 | if (eNotificationRequired())
|
---|
378 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, DECENTPackage.ACTIVITY__AGENT_STATE, oldAgentState, agentState));
|
---|
379 | }
|
---|
380 | }
|
---|
381 | return agentState;
|
---|
382 | }
|
---|
383 |
|
---|
384 | /**
|
---|
385 | * <!-- begin-user-doc -->
|
---|
386 | * <!-- end-user-doc -->
|
---|
387 | * @generated
|
---|
388 | */
|
---|
389 | public AgentState basicGetAgentState() {
|
---|
390 | return agentState;
|
---|
391 | }
|
---|
392 |
|
---|
393 | /**
|
---|
394 | * <!-- begin-user-doc -->
|
---|
395 | * <!-- end-user-doc -->
|
---|
396 | * @generated
|
---|
397 | */
|
---|
398 | public NotificationChain basicSetAgentState(AgentState newAgentState, NotificationChain msgs) {
|
---|
399 | AgentState oldAgentState = agentState;
|
---|
400 | agentState = newAgentState;
|
---|
401 | if (eNotificationRequired()) {
|
---|
402 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__AGENT_STATE, oldAgentState, newAgentState);
|
---|
403 | if (msgs == null) msgs = notification; else msgs.add(notification);
|
---|
404 | }
|
---|
405 | return msgs;
|
---|
406 | }
|
---|
407 |
|
---|
408 | /**
|
---|
409 | * <!-- begin-user-doc -->
|
---|
410 | * <!-- end-user-doc -->
|
---|
411 | * @generated
|
---|
412 | */
|
---|
413 | public void setAgentState(AgentState newAgentState) {
|
---|
414 | if (newAgentState != agentState) {
|
---|
415 | NotificationChain msgs = null;
|
---|
416 | if (agentState != null)
|
---|
417 | msgs = ((InternalEObject)agentState).eInverseRemove(this, DECENTPackage.AGENT_STATE__ACTIVITIES, AgentState.class, msgs);
|
---|
418 | if (newAgentState != null)
|
---|
419 | msgs = ((InternalEObject)newAgentState).eInverseAdd(this, DECENTPackage.AGENT_STATE__ACTIVITIES, AgentState.class, msgs);
|
---|
420 | msgs = basicSetAgentState(newAgentState, msgs);
|
---|
421 | if (msgs != null) msgs.dispatch();
|
---|
422 | }
|
---|
423 | else if (eNotificationRequired())
|
---|
424 | eNotify(new ENotificationImpl(this, Notification.SET, DECENTPackage.ACTIVITY__AGENT_STATE, newAgentState, newAgentState));
|
---|
425 | }
|
---|
426 |
|
---|
427 | /**
|
---|
428 | * <!-- begin-user-doc -->
|
---|
429 | * <!-- end-user-doc -->
|
---|
430 | * @generated
|
---|
431 | */
|
---|
432 | @SuppressWarnings("unchecked")
|
---|
433 | @Override
|
---|
434 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
---|
435 | switch (featureID) {
|
---|
436 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
437 | if (eInternalContainer() != null)
|
---|
438 | msgs = eBasicRemoveFromContainer(msgs);
|
---|
439 | return basicSetAgent((Agent)otherEnd, msgs);
|
---|
440 | case DECENTPackage.ACTIVITY__STATE:
|
---|
441 | if (state != null)
|
---|
442 | msgs = ((InternalEObject)state).eInverseRemove(this, DECENTPackage.STATE__ACTIVITY, State.class, msgs);
|
---|
443 | return basicSetState((State)otherEnd, msgs);
|
---|
444 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
445 | if (targetState != null)
|
---|
446 | msgs = ((InternalEObject)targetState).eInverseRemove(this, DECENTPackage.STATE__FROM_ACTIVITY, State.class, msgs);
|
---|
447 | return basicSetTargetState((State)otherEnd, msgs);
|
---|
448 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
449 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getDeltas()).basicAdd(otherEnd, msgs);
|
---|
450 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
451 | if (agentState != null)
|
---|
452 | msgs = ((InternalEObject)agentState).eInverseRemove(this, DECENTPackage.AGENT_STATE__ACTIVITIES, AgentState.class, msgs);
|
---|
453 | return basicSetAgentState((AgentState)otherEnd, msgs);
|
---|
454 | }
|
---|
455 | return super.eInverseAdd(otherEnd, featureID, msgs);
|
---|
456 | }
|
---|
457 |
|
---|
458 | /**
|
---|
459 | * <!-- begin-user-doc -->
|
---|
460 | * <!-- end-user-doc -->
|
---|
461 | * @generated
|
---|
462 | */
|
---|
463 | @Override
|
---|
464 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
---|
465 | switch (featureID) {
|
---|
466 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
467 | return basicSetAgent(null, msgs);
|
---|
468 | case DECENTPackage.ACTIVITY__STATE:
|
---|
469 | return basicSetState(null, msgs);
|
---|
470 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
471 | return basicSetTargetState(null, msgs);
|
---|
472 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
473 | return ((InternalEList<?>)getDeltas()).basicRemove(otherEnd, msgs);
|
---|
474 | case DECENTPackage.ACTIVITY__VALUES:
|
---|
475 | return ((InternalEList<?>)getValues()).basicRemove(otherEnd, msgs);
|
---|
476 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
477 | return basicSetAgentState(null, msgs);
|
---|
478 | }
|
---|
479 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
480 | }
|
---|
481 |
|
---|
482 | /**
|
---|
483 | * <!-- begin-user-doc -->
|
---|
484 | * <!-- end-user-doc -->
|
---|
485 | * @generated
|
---|
486 | */
|
---|
487 | @Override
|
---|
488 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
|
---|
489 | switch (eContainerFeatureID()) {
|
---|
490 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
491 | return eInternalContainer().eInverseRemove(this, DECENTPackage.AGENT__ACTIVITIES, Agent.class, msgs);
|
---|
492 | }
|
---|
493 | return super.eBasicRemoveFromContainerFeature(msgs);
|
---|
494 | }
|
---|
495 |
|
---|
496 | /**
|
---|
497 | * <!-- begin-user-doc -->
|
---|
498 | * <!-- end-user-doc -->
|
---|
499 | * @generated
|
---|
500 | */
|
---|
501 | @Override
|
---|
502 | public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
---|
503 | switch (featureID) {
|
---|
504 | case DECENTPackage.ACTIVITY__TYPE:
|
---|
505 | return getType();
|
---|
506 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
507 | return getAgent();
|
---|
508 | case DECENTPackage.ACTIVITY__STATE:
|
---|
509 | if (resolve) return getState();
|
---|
510 | return basicGetState();
|
---|
511 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
512 | if (resolve) return getTargetState();
|
---|
513 | return basicGetTargetState();
|
---|
514 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
515 | return getDeltas();
|
---|
516 | case DECENTPackage.ACTIVITY__DATE:
|
---|
517 | return getDate();
|
---|
518 | case DECENTPackage.ACTIVITY__VALUES:
|
---|
519 | return getValues();
|
---|
520 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
521 | if (resolve) return getAgentState();
|
---|
522 | return basicGetAgentState();
|
---|
523 | }
|
---|
524 | return super.eGet(featureID, resolve, coreType);
|
---|
525 | }
|
---|
526 |
|
---|
527 | /**
|
---|
528 | * <!-- begin-user-doc -->
|
---|
529 | * <!-- end-user-doc -->
|
---|
530 | * @generated
|
---|
531 | */
|
---|
532 | @SuppressWarnings("unchecked")
|
---|
533 | @Override
|
---|
534 | public void eSet(int featureID, Object newValue) {
|
---|
535 | switch (featureID) {
|
---|
536 | case DECENTPackage.ACTIVITY__TYPE:
|
---|
537 | getType().clear();
|
---|
538 | getType().addAll((Collection<? extends ActivityType>)newValue);
|
---|
539 | return;
|
---|
540 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
541 | setAgent((Agent)newValue);
|
---|
542 | return;
|
---|
543 | case DECENTPackage.ACTIVITY__STATE:
|
---|
544 | setState((State)newValue);
|
---|
545 | return;
|
---|
546 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
547 | setTargetState((State)newValue);
|
---|
548 | return;
|
---|
549 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
550 | getDeltas().clear();
|
---|
551 | getDeltas().addAll((Collection<? extends Delta>)newValue);
|
---|
552 | return;
|
---|
553 | case DECENTPackage.ACTIVITY__DATE:
|
---|
554 | setDate((Date)newValue);
|
---|
555 | return;
|
---|
556 | case DECENTPackage.ACTIVITY__VALUES:
|
---|
557 | getValues().clear();
|
---|
558 | getValues().addAll((Collection<? extends Value>)newValue);
|
---|
559 | return;
|
---|
560 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
561 | setAgentState((AgentState)newValue);
|
---|
562 | return;
|
---|
563 | }
|
---|
564 | super.eSet(featureID, newValue);
|
---|
565 | }
|
---|
566 |
|
---|
567 | /**
|
---|
568 | * <!-- begin-user-doc -->
|
---|
569 | * <!-- end-user-doc -->
|
---|
570 | * @generated
|
---|
571 | */
|
---|
572 | @Override
|
---|
573 | public void eUnset(int featureID) {
|
---|
574 | switch (featureID) {
|
---|
575 | case DECENTPackage.ACTIVITY__TYPE:
|
---|
576 | getType().clear();
|
---|
577 | return;
|
---|
578 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
579 | setAgent((Agent)null);
|
---|
580 | return;
|
---|
581 | case DECENTPackage.ACTIVITY__STATE:
|
---|
582 | setState((State)null);
|
---|
583 | return;
|
---|
584 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
585 | setTargetState((State)null);
|
---|
586 | return;
|
---|
587 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
588 | getDeltas().clear();
|
---|
589 | return;
|
---|
590 | case DECENTPackage.ACTIVITY__DATE:
|
---|
591 | setDate(DATE_EDEFAULT);
|
---|
592 | return;
|
---|
593 | case DECENTPackage.ACTIVITY__VALUES:
|
---|
594 | getValues().clear();
|
---|
595 | return;
|
---|
596 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
597 | setAgentState((AgentState)null);
|
---|
598 | return;
|
---|
599 | }
|
---|
600 | super.eUnset(featureID);
|
---|
601 | }
|
---|
602 |
|
---|
603 | /**
|
---|
604 | * <!-- begin-user-doc -->
|
---|
605 | * <!-- end-user-doc -->
|
---|
606 | * @generated
|
---|
607 | */
|
---|
608 | @Override
|
---|
609 | public boolean eIsSet(int featureID) {
|
---|
610 | switch (featureID) {
|
---|
611 | case DECENTPackage.ACTIVITY__TYPE:
|
---|
612 | return type != null && !type.isEmpty();
|
---|
613 | case DECENTPackage.ACTIVITY__AGENT:
|
---|
614 | return getAgent() != null;
|
---|
615 | case DECENTPackage.ACTIVITY__STATE:
|
---|
616 | return state != null;
|
---|
617 | case DECENTPackage.ACTIVITY__TARGET_STATE:
|
---|
618 | return targetState != null;
|
---|
619 | case DECENTPackage.ACTIVITY__DELTAS:
|
---|
620 | return deltas != null && !deltas.isEmpty();
|
---|
621 | case DECENTPackage.ACTIVITY__DATE:
|
---|
622 | return DATE_EDEFAULT == null ? date != null : !DATE_EDEFAULT.equals(date);
|
---|
623 | case DECENTPackage.ACTIVITY__VALUES:
|
---|
624 | return values != null && !values.isEmpty();
|
---|
625 | case DECENTPackage.ACTIVITY__AGENT_STATE:
|
---|
626 | return agentState != null;
|
---|
627 | }
|
---|
628 | return super.eIsSet(featureID);
|
---|
629 | }
|
---|
630 |
|
---|
631 | /**
|
---|
632 | * <!-- begin-user-doc -->
|
---|
633 | * <!-- end-user-doc -->
|
---|
634 | * @generated
|
---|
635 | */
|
---|
636 | @Override
|
---|
637 | public String toString() {
|
---|
638 | if (eIsProxy()) return super.toString();
|
---|
639 |
|
---|
640 | StringBuffer result = new StringBuffer(super.toString());
|
---|
641 | result.append(" (date: ");
|
---|
642 | result.append(date);
|
---|
643 | result.append(')');
|
---|
644 | return result.toString();
|
---|
645 | }
|
---|
646 |
|
---|
647 | } //ActivityImpl
|
---|