1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.cpdp.decentApp.models.decent.impl;
|
---|
4 |
|
---|
5 | import java.util.Collection;
|
---|
6 |
|
---|
7 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
8 | import org.eclipse.emf.common.util.EList;
|
---|
9 | import org.eclipse.emf.ecore.EClass;
|
---|
10 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
11 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
12 | import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
---|
13 | import org.eclipse.emf.ecore.util.InternalEList;
|
---|
14 |
|
---|
15 | import de.ugoe.cs.cpdp.decentApp.models.decent.Agent;
|
---|
16 | import de.ugoe.cs.cpdp.decentApp.models.decent.AgentPool;
|
---|
17 | import de.ugoe.cs.cpdp.decentApp.models.decent.DECENTPackage;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * <!-- begin-user-doc -->
|
---|
21 | * An implementation of the model object '<em><b>Agent Pool</b></em>'.
|
---|
22 | * <!-- end-user-doc -->
|
---|
23 | * <p>
|
---|
24 | * The following features are implemented:
|
---|
25 | * <ul>
|
---|
26 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.decent.impl.AgentPoolImpl#getAgents <em>Agents</em>}</li>
|
---|
27 | * </ul>
|
---|
28 | * </p>
|
---|
29 | *
|
---|
30 | * @generated
|
---|
31 | */
|
---|
32 | public class AgentPoolImpl extends MinimalEObjectImpl.Container implements AgentPool {
|
---|
33 | /**
|
---|
34 | * The cached value of the '{@link #getAgents() <em>Agents</em>}' containment reference list.
|
---|
35 | * <!-- begin-user-doc -->
|
---|
36 | * <!-- end-user-doc -->
|
---|
37 | * @see #getAgents()
|
---|
38 | * @generated
|
---|
39 | * @ordered
|
---|
40 | */
|
---|
41 | protected EList<Agent> agents;
|
---|
42 |
|
---|
43 | /**
|
---|
44 | * <!-- begin-user-doc -->
|
---|
45 | * <!-- end-user-doc -->
|
---|
46 | * @generated
|
---|
47 | */
|
---|
48 | protected AgentPoolImpl() {
|
---|
49 | super();
|
---|
50 | }
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * <!-- begin-user-doc -->
|
---|
54 | * <!-- end-user-doc -->
|
---|
55 | * @generated
|
---|
56 | */
|
---|
57 | @Override
|
---|
58 | protected EClass eStaticClass() {
|
---|
59 | return DECENTPackage.Literals.AGENT_POOL;
|
---|
60 | }
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * <!-- begin-user-doc -->
|
---|
64 | * <!-- end-user-doc -->
|
---|
65 | * @generated
|
---|
66 | */
|
---|
67 | public EList<Agent> getAgents() {
|
---|
68 | if (agents == null) {
|
---|
69 | agents = new EObjectContainmentEList<Agent>(Agent.class, this, DECENTPackage.AGENT_POOL__AGENTS);
|
---|
70 | }
|
---|
71 | return agents;
|
---|
72 | }
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * <!-- begin-user-doc -->
|
---|
76 | * <!-- end-user-doc -->
|
---|
77 | * @generated
|
---|
78 | */
|
---|
79 | @Override
|
---|
80 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
---|
81 | switch (featureID) {
|
---|
82 | case DECENTPackage.AGENT_POOL__AGENTS:
|
---|
83 | return ((InternalEList<?>)getAgents()).basicRemove(otherEnd, msgs);
|
---|
84 | }
|
---|
85 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
86 | }
|
---|
87 |
|
---|
88 | /**
|
---|
89 | * <!-- begin-user-doc -->
|
---|
90 | * <!-- end-user-doc -->
|
---|
91 | * @generated
|
---|
92 | */
|
---|
93 | @Override
|
---|
94 | public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
---|
95 | switch (featureID) {
|
---|
96 | case DECENTPackage.AGENT_POOL__AGENTS:
|
---|
97 | return getAgents();
|
---|
98 | }
|
---|
99 | return super.eGet(featureID, resolve, coreType);
|
---|
100 | }
|
---|
101 |
|
---|
102 | /**
|
---|
103 | * <!-- begin-user-doc -->
|
---|
104 | * <!-- end-user-doc -->
|
---|
105 | * @generated
|
---|
106 | */
|
---|
107 | @SuppressWarnings("unchecked")
|
---|
108 | @Override
|
---|
109 | public void eSet(int featureID, Object newValue) {
|
---|
110 | switch (featureID) {
|
---|
111 | case DECENTPackage.AGENT_POOL__AGENTS:
|
---|
112 | getAgents().clear();
|
---|
113 | getAgents().addAll((Collection<? extends Agent>)newValue);
|
---|
114 | return;
|
---|
115 | }
|
---|
116 | super.eSet(featureID, newValue);
|
---|
117 | }
|
---|
118 |
|
---|
119 | /**
|
---|
120 | * <!-- begin-user-doc -->
|
---|
121 | * <!-- end-user-doc -->
|
---|
122 | * @generated
|
---|
123 | */
|
---|
124 | @Override
|
---|
125 | public void eUnset(int featureID) {
|
---|
126 | switch (featureID) {
|
---|
127 | case DECENTPackage.AGENT_POOL__AGENTS:
|
---|
128 | getAgents().clear();
|
---|
129 | return;
|
---|
130 | }
|
---|
131 | super.eUnset(featureID);
|
---|
132 | }
|
---|
133 |
|
---|
134 | /**
|
---|
135 | * <!-- begin-user-doc -->
|
---|
136 | * <!-- end-user-doc -->
|
---|
137 | * @generated
|
---|
138 | */
|
---|
139 | @Override
|
---|
140 | public boolean eIsSet(int featureID) {
|
---|
141 | switch (featureID) {
|
---|
142 | case DECENTPackage.AGENT_POOL__AGENTS:
|
---|
143 | return agents != null && !agents.isEmpty();
|
---|
144 | }
|
---|
145 | return super.eIsSet(featureID);
|
---|
146 | }
|
---|
147 |
|
---|
148 | } //AgentPoolImpl
|
---|