1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore.impl; |
8 | |
9 | import LqnCore.ActivityDefType; |
10 | import LqnCore.ActivityMakingCallType; |
11 | import LqnCore.CallListType; |
12 | import LqnCore.LqnCorePackage; |
13 | |
14 | import java.util.Collection; |
15 | |
16 | import org.eclipse.emf.common.notify.Notification; |
17 | import org.eclipse.emf.common.notify.NotificationChain; |
18 | |
19 | import org.eclipse.emf.common.util.EList; |
20 | |
21 | import org.eclipse.emf.ecore.EClass; |
22 | import org.eclipse.emf.ecore.InternalEObject; |
23 | |
24 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
25 | |
26 | import org.eclipse.emf.ecore.util.BasicFeatureMap; |
27 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
28 | import org.eclipse.emf.ecore.util.FeatureMap; |
29 | import org.eclipse.emf.ecore.util.InternalEList; |
30 | |
31 | /** |
32 | * <!-- begin-user-doc --> |
33 | * An implementation of the model object '<em><b>Activity Def Type</b></em>'. |
34 | * <!-- end-user-doc --> |
35 | * <p> |
36 | * The following features are implemented: |
37 | * <ul> |
38 | * <li>{@link LqnCore.impl.ActivityDefTypeImpl#getCallList <em>Call List</em>}</li> |
39 | * <li>{@link LqnCore.impl.ActivityDefTypeImpl#getGroup <em>Group</em>}</li> |
40 | * <li>{@link LqnCore.impl.ActivityDefTypeImpl#getSynchCall <em>Synch Call</em>}</li> |
41 | * <li>{@link LqnCore.impl.ActivityDefTypeImpl#getAsynchCall <em>Asynch Call</em>}</li> |
42 | * <li>{@link LqnCore.impl.ActivityDefTypeImpl#getBoundToEntry <em>Bound To Entry</em>}</li> |
43 | * </ul> |
44 | * </p> |
45 | * |
46 | * @generated |
47 | */ |
48 | public class ActivityDefTypeImpl extends ActivityDefBaseImpl implements ActivityDefType { |
49 | /** |
50 | * The cached value of the '{@link #getCallList() <em>Call List</em>}' containment reference list. |
51 | * <!-- begin-user-doc --> |
52 | * <!-- end-user-doc --> |
53 | * @see #getCallList() |
54 | * @generated |
55 | * @ordered |
56 | */ |
57 | protected EList<CallListType> callList; |
58 | |
59 | /** |
60 | * The cached value of the '{@link #getGroup() <em>Group</em>}' attribute list. |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @see #getGroup() |
64 | * @generated |
65 | * @ordered |
66 | */ |
67 | protected FeatureMap group; |
68 | |
69 | /** |
70 | * The default value of the '{@link #getBoundToEntry() <em>Bound To Entry</em>}' attribute. |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @see #getBoundToEntry() |
74 | * @generated |
75 | * @ordered |
76 | */ |
77 | protected static final String BOUND_TO_ENTRY_EDEFAULT = null; |
78 | |
79 | /** |
80 | * The cached value of the '{@link #getBoundToEntry() <em>Bound To Entry</em>}' attribute. |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @see #getBoundToEntry() |
84 | * @generated |
85 | * @ordered |
86 | */ |
87 | protected String boundToEntry = BOUND_TO_ENTRY_EDEFAULT; |
88 | |
89 | /** |
90 | * <!-- begin-user-doc --> |
91 | * <!-- end-user-doc --> |
92 | * @generated |
93 | */ |
94 | protected ActivityDefTypeImpl() { |
95 | super(); |
96 | } |
97 | |
98 | /** |
99 | * <!-- begin-user-doc --> |
100 | * <!-- end-user-doc --> |
101 | * @generated |
102 | */ |
103 | @Override |
104 | protected EClass eStaticClass() { |
105 | return LqnCorePackage.Literals.ACTIVITY_DEF_TYPE; |
106 | } |
107 | |
108 | /** |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | public EList<CallListType> getCallList() { |
114 | if (callList == null) { |
115 | callList = new EObjectContainmentEList<CallListType>(CallListType.class, this, LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST); |
116 | } |
117 | return callList; |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | public FeatureMap getGroup() { |
126 | if (group == null) { |
127 | group = new BasicFeatureMap(this, LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP); |
128 | } |
129 | return group; |
130 | } |
131 | |
132 | /** |
133 | * <!-- begin-user-doc --> |
134 | * <!-- end-user-doc --> |
135 | * @generated |
136 | */ |
137 | public EList<ActivityMakingCallType> getSynchCall() { |
138 | return getGroup().list(LqnCorePackage.Literals.ACTIVITY_DEF_TYPE__SYNCH_CALL); |
139 | } |
140 | |
141 | /** |
142 | * <!-- begin-user-doc --> |
143 | * <!-- end-user-doc --> |
144 | * @generated |
145 | */ |
146 | public EList<ActivityMakingCallType> getAsynchCall() { |
147 | return getGroup().list(LqnCorePackage.Literals.ACTIVITY_DEF_TYPE__ASYNCH_CALL); |
148 | } |
149 | |
150 | /** |
151 | * <!-- begin-user-doc --> |
152 | * <!-- end-user-doc --> |
153 | * @generated |
154 | */ |
155 | public String getBoundToEntry() { |
156 | return boundToEntry; |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | public void setBoundToEntry(String newBoundToEntry) { |
165 | String oldBoundToEntry = boundToEntry; |
166 | boundToEntry = newBoundToEntry; |
167 | if (eNotificationRequired()) |
168 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.ACTIVITY_DEF_TYPE__BOUND_TO_ENTRY, oldBoundToEntry, boundToEntry)); |
169 | } |
170 | |
171 | /** |
172 | * <!-- begin-user-doc --> |
173 | * <!-- end-user-doc --> |
174 | * @generated |
175 | */ |
176 | @Override |
177 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
178 | switch (featureID) { |
179 | case LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST: |
180 | return ((InternalEList<?>)getCallList()).basicRemove(otherEnd, msgs); |
181 | case LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP: |
182 | return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs); |
183 | case LqnCorePackage.ACTIVITY_DEF_TYPE__SYNCH_CALL: |
184 | return ((InternalEList<?>)getSynchCall()).basicRemove(otherEnd, msgs); |
185 | case LqnCorePackage.ACTIVITY_DEF_TYPE__ASYNCH_CALL: |
186 | return ((InternalEList<?>)getAsynchCall()).basicRemove(otherEnd, msgs); |
187 | } |
188 | return super.eInverseRemove(otherEnd, featureID, msgs); |
189 | } |
190 | |
191 | /** |
192 | * <!-- begin-user-doc --> |
193 | * <!-- end-user-doc --> |
194 | * @generated |
195 | */ |
196 | @Override |
197 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
198 | switch (featureID) { |
199 | case LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST: |
200 | return getCallList(); |
201 | case LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP: |
202 | if (coreType) return getGroup(); |
203 | return ((FeatureMap.Internal)getGroup()).getWrapper(); |
204 | case LqnCorePackage.ACTIVITY_DEF_TYPE__SYNCH_CALL: |
205 | return getSynchCall(); |
206 | case LqnCorePackage.ACTIVITY_DEF_TYPE__ASYNCH_CALL: |
207 | return getAsynchCall(); |
208 | case LqnCorePackage.ACTIVITY_DEF_TYPE__BOUND_TO_ENTRY: |
209 | return getBoundToEntry(); |
210 | } |
211 | return super.eGet(featureID, resolve, coreType); |
212 | } |
213 | |
214 | /** |
215 | * <!-- begin-user-doc --> |
216 | * <!-- end-user-doc --> |
217 | * @generated |
218 | */ |
219 | @SuppressWarnings("unchecked") |
220 | @Override |
221 | public void eSet(int featureID, Object newValue) { |
222 | switch (featureID) { |
223 | case LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST: |
224 | getCallList().clear(); |
225 | getCallList().addAll((Collection<? extends CallListType>)newValue); |
226 | return; |
227 | case LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP: |
228 | ((FeatureMap.Internal)getGroup()).set(newValue); |
229 | return; |
230 | case LqnCorePackage.ACTIVITY_DEF_TYPE__SYNCH_CALL: |
231 | getSynchCall().clear(); |
232 | getSynchCall().addAll((Collection<? extends ActivityMakingCallType>)newValue); |
233 | return; |
234 | case LqnCorePackage.ACTIVITY_DEF_TYPE__ASYNCH_CALL: |
235 | getAsynchCall().clear(); |
236 | getAsynchCall().addAll((Collection<? extends ActivityMakingCallType>)newValue); |
237 | return; |
238 | case LqnCorePackage.ACTIVITY_DEF_TYPE__BOUND_TO_ENTRY: |
239 | setBoundToEntry((String)newValue); |
240 | return; |
241 | } |
242 | super.eSet(featureID, newValue); |
243 | } |
244 | |
245 | /** |
246 | * <!-- begin-user-doc --> |
247 | * <!-- end-user-doc --> |
248 | * @generated |
249 | */ |
250 | @Override |
251 | public void eUnset(int featureID) { |
252 | switch (featureID) { |
253 | case LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST: |
254 | getCallList().clear(); |
255 | return; |
256 | case LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP: |
257 | getGroup().clear(); |
258 | return; |
259 | case LqnCorePackage.ACTIVITY_DEF_TYPE__SYNCH_CALL: |
260 | getSynchCall().clear(); |
261 | return; |
262 | case LqnCorePackage.ACTIVITY_DEF_TYPE__ASYNCH_CALL: |
263 | getAsynchCall().clear(); |
264 | return; |
265 | case LqnCorePackage.ACTIVITY_DEF_TYPE__BOUND_TO_ENTRY: |
266 | setBoundToEntry(BOUND_TO_ENTRY_EDEFAULT); |
267 | return; |
268 | } |
269 | super.eUnset(featureID); |
270 | } |
271 | |
272 | /** |
273 | * <!-- begin-user-doc --> |
274 | * <!-- end-user-doc --> |
275 | * @generated |
276 | */ |
277 | @Override |
278 | public boolean eIsSet(int featureID) { |
279 | switch (featureID) { |
280 | case LqnCorePackage.ACTIVITY_DEF_TYPE__CALL_LIST: |
281 | return callList != null && !callList.isEmpty(); |
282 | case LqnCorePackage.ACTIVITY_DEF_TYPE__GROUP: |
283 | return group != null && !group.isEmpty(); |
284 | case LqnCorePackage.ACTIVITY_DEF_TYPE__SYNCH_CALL: |
285 | return !getSynchCall().isEmpty(); |
286 | case LqnCorePackage.ACTIVITY_DEF_TYPE__ASYNCH_CALL: |
287 | return !getAsynchCall().isEmpty(); |
288 | case LqnCorePackage.ACTIVITY_DEF_TYPE__BOUND_TO_ENTRY: |
289 | return BOUND_TO_ENTRY_EDEFAULT == null ? boundToEntry != null : !BOUND_TO_ENTRY_EDEFAULT.equals(boundToEntry); |
290 | } |
291 | return super.eIsSet(featureID); |
292 | } |
293 | |
294 | /** |
295 | * <!-- begin-user-doc --> |
296 | * <!-- end-user-doc --> |
297 | * @generated |
298 | */ |
299 | @Override |
300 | public String toString() { |
301 | if (eIsProxy()) return super.toString(); |
302 | |
303 | StringBuffer result = new StringBuffer(super.toString()); |
304 | result.append(" (group: "); |
305 | result.append(group); |
306 | result.append(", boundToEntry: "); |
307 | result.append(boundToEntry); |
308 | result.append(')'); |
309 | return result.toString(); |
310 | } |
311 | |
312 | } //ActivityDefTypeImpl |