1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore.impl; |
8 | |
9 | import LqnCore.LqnCorePackage; |
10 | import LqnCore.MakingCallType; |
11 | import LqnCore.OutputResultType; |
12 | |
13 | import java.util.Collection; |
14 | |
15 | import org.eclipse.emf.common.notify.Notification; |
16 | import org.eclipse.emf.common.notify.NotificationChain; |
17 | |
18 | import org.eclipse.emf.common.util.EList; |
19 | |
20 | import org.eclipse.emf.ecore.EClass; |
21 | import org.eclipse.emf.ecore.InternalEObject; |
22 | |
23 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
24 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
25 | |
26 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
27 | import org.eclipse.emf.ecore.util.InternalEList; |
28 | |
29 | /** |
30 | * <!-- begin-user-doc --> |
31 | * An implementation of the model object '<em><b>Making Call Type</b></em>'. |
32 | * <!-- end-user-doc --> |
33 | * <p> |
34 | * The following features are implemented: |
35 | * <ul> |
36 | * <li>{@link LqnCore.impl.MakingCallTypeImpl#getResultCall <em>Result Call</em>}</li> |
37 | * <li>{@link LqnCore.impl.MakingCallTypeImpl#getDest <em>Dest</em>}</li> |
38 | * <li>{@link LqnCore.impl.MakingCallTypeImpl#getFanin <em>Fanin</em>}</li> |
39 | * <li>{@link LqnCore.impl.MakingCallTypeImpl#getFanout <em>Fanout</em>}</li> |
40 | * </ul> |
41 | * </p> |
42 | * |
43 | * @generated |
44 | */ |
45 | public class MakingCallTypeImpl extends EObjectImpl implements MakingCallType { |
46 | /** |
47 | * The cached value of the '{@link #getResultCall() <em>Result Call</em>}' containment reference list. |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @see #getResultCall() |
51 | * @generated |
52 | * @ordered |
53 | */ |
54 | protected EList<OutputResultType> resultCall; |
55 | |
56 | /** |
57 | * The default value of the '{@link #getDest() <em>Dest</em>}' attribute. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @see #getDest() |
61 | * @generated |
62 | * @ordered |
63 | */ |
64 | protected static final String DEST_EDEFAULT = null; |
65 | |
66 | /** |
67 | * The cached value of the '{@link #getDest() <em>Dest</em>}' attribute. |
68 | * <!-- begin-user-doc --> |
69 | * <!-- end-user-doc --> |
70 | * @see #getDest() |
71 | * @generated |
72 | * @ordered |
73 | */ |
74 | protected String dest = DEST_EDEFAULT; |
75 | |
76 | /** |
77 | * The default value of the '{@link #getFanin() <em>Fanin</em>}' attribute. |
78 | * <!-- begin-user-doc --> |
79 | * <!-- end-user-doc --> |
80 | * @see #getFanin() |
81 | * @generated |
82 | * @ordered |
83 | */ |
84 | protected static final int FANIN_EDEFAULT = 0; |
85 | |
86 | /** |
87 | * The cached value of the '{@link #getFanin() <em>Fanin</em>}' attribute. |
88 | * <!-- begin-user-doc --> |
89 | * <!-- end-user-doc --> |
90 | * @see #getFanin() |
91 | * @generated |
92 | * @ordered |
93 | */ |
94 | protected int fanin = FANIN_EDEFAULT; |
95 | |
96 | /** |
97 | * This is true if the Fanin attribute has been set. |
98 | * <!-- begin-user-doc --> |
99 | * <!-- end-user-doc --> |
100 | * @generated |
101 | * @ordered |
102 | */ |
103 | protected boolean faninESet; |
104 | |
105 | /** |
106 | * The default value of the '{@link #getFanout() <em>Fanout</em>}' attribute. |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @see #getFanout() |
110 | * @generated |
111 | * @ordered |
112 | */ |
113 | protected static final int FANOUT_EDEFAULT = 0; |
114 | |
115 | /** |
116 | * The cached value of the '{@link #getFanout() <em>Fanout</em>}' attribute. |
117 | * <!-- begin-user-doc --> |
118 | * <!-- end-user-doc --> |
119 | * @see #getFanout() |
120 | * @generated |
121 | * @ordered |
122 | */ |
123 | protected int fanout = FANOUT_EDEFAULT; |
124 | |
125 | /** |
126 | * This is true if the Fanout attribute has been set. |
127 | * <!-- begin-user-doc --> |
128 | * <!-- end-user-doc --> |
129 | * @generated |
130 | * @ordered |
131 | */ |
132 | protected boolean fanoutESet; |
133 | |
134 | /** |
135 | * <!-- begin-user-doc --> |
136 | * <!-- end-user-doc --> |
137 | * @generated |
138 | */ |
139 | protected MakingCallTypeImpl() { |
140 | super(); |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | @Override |
149 | protected EClass eStaticClass() { |
150 | return LqnCorePackage.Literals.MAKING_CALL_TYPE; |
151 | } |
152 | |
153 | /** |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public EList<OutputResultType> getResultCall() { |
159 | if (resultCall == null) { |
160 | resultCall = new EObjectContainmentEList<OutputResultType>(OutputResultType.class, this, LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL); |
161 | } |
162 | return resultCall; |
163 | } |
164 | |
165 | /** |
166 | * <!-- begin-user-doc --> |
167 | * <!-- end-user-doc --> |
168 | * @generated |
169 | */ |
170 | public String getDest() { |
171 | return dest; |
172 | } |
173 | |
174 | /** |
175 | * <!-- begin-user-doc --> |
176 | * <!-- end-user-doc --> |
177 | * @generated |
178 | */ |
179 | public void setDest(String newDest) { |
180 | String oldDest = dest; |
181 | dest = newDest; |
182 | if (eNotificationRequired()) |
183 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.MAKING_CALL_TYPE__DEST, oldDest, dest)); |
184 | } |
185 | |
186 | /** |
187 | * <!-- begin-user-doc --> |
188 | * <!-- end-user-doc --> |
189 | * @generated |
190 | */ |
191 | public int getFanin() { |
192 | return fanin; |
193 | } |
194 | |
195 | /** |
196 | * <!-- begin-user-doc --> |
197 | * <!-- end-user-doc --> |
198 | * @generated |
199 | */ |
200 | public void setFanin(int newFanin) { |
201 | int oldFanin = fanin; |
202 | fanin = newFanin; |
203 | boolean oldFaninESet = faninESet; |
204 | faninESet = true; |
205 | if (eNotificationRequired()) |
206 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.MAKING_CALL_TYPE__FANIN, oldFanin, fanin, !oldFaninESet)); |
207 | } |
208 | |
209 | /** |
210 | * <!-- begin-user-doc --> |
211 | * <!-- end-user-doc --> |
212 | * @generated |
213 | */ |
214 | public void unsetFanin() { |
215 | int oldFanin = fanin; |
216 | boolean oldFaninESet = faninESet; |
217 | fanin = FANIN_EDEFAULT; |
218 | faninESet = false; |
219 | if (eNotificationRequired()) |
220 | eNotify(new ENotificationImpl(this, Notification.UNSET, LqnCorePackage.MAKING_CALL_TYPE__FANIN, oldFanin, FANIN_EDEFAULT, oldFaninESet)); |
221 | } |
222 | |
223 | /** |
224 | * <!-- begin-user-doc --> |
225 | * <!-- end-user-doc --> |
226 | * @generated |
227 | */ |
228 | public boolean isSetFanin() { |
229 | return faninESet; |
230 | } |
231 | |
232 | /** |
233 | * <!-- begin-user-doc --> |
234 | * <!-- end-user-doc --> |
235 | * @generated |
236 | */ |
237 | public int getFanout() { |
238 | return fanout; |
239 | } |
240 | |
241 | /** |
242 | * <!-- begin-user-doc --> |
243 | * <!-- end-user-doc --> |
244 | * @generated |
245 | */ |
246 | public void setFanout(int newFanout) { |
247 | int oldFanout = fanout; |
248 | fanout = newFanout; |
249 | boolean oldFanoutESet = fanoutESet; |
250 | fanoutESet = true; |
251 | if (eNotificationRequired()) |
252 | eNotify(new ENotificationImpl(this, Notification.SET, LqnCorePackage.MAKING_CALL_TYPE__FANOUT, oldFanout, fanout, !oldFanoutESet)); |
253 | } |
254 | |
255 | /** |
256 | * <!-- begin-user-doc --> |
257 | * <!-- end-user-doc --> |
258 | * @generated |
259 | */ |
260 | public void unsetFanout() { |
261 | int oldFanout = fanout; |
262 | boolean oldFanoutESet = fanoutESet; |
263 | fanout = FANOUT_EDEFAULT; |
264 | fanoutESet = false; |
265 | if (eNotificationRequired()) |
266 | eNotify(new ENotificationImpl(this, Notification.UNSET, LqnCorePackage.MAKING_CALL_TYPE__FANOUT, oldFanout, FANOUT_EDEFAULT, oldFanoutESet)); |
267 | } |
268 | |
269 | /** |
270 | * <!-- begin-user-doc --> |
271 | * <!-- end-user-doc --> |
272 | * @generated |
273 | */ |
274 | public boolean isSetFanout() { |
275 | return fanoutESet; |
276 | } |
277 | |
278 | /** |
279 | * <!-- begin-user-doc --> |
280 | * <!-- end-user-doc --> |
281 | * @generated |
282 | */ |
283 | @Override |
284 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
285 | switch (featureID) { |
286 | case LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL: |
287 | return ((InternalEList<?>)getResultCall()).basicRemove(otherEnd, msgs); |
288 | } |
289 | return super.eInverseRemove(otherEnd, featureID, msgs); |
290 | } |
291 | |
292 | /** |
293 | * <!-- begin-user-doc --> |
294 | * <!-- end-user-doc --> |
295 | * @generated |
296 | */ |
297 | @Override |
298 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
299 | switch (featureID) { |
300 | case LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL: |
301 | return getResultCall(); |
302 | case LqnCorePackage.MAKING_CALL_TYPE__DEST: |
303 | return getDest(); |
304 | case LqnCorePackage.MAKING_CALL_TYPE__FANIN: |
305 | return new Integer(getFanin()); |
306 | case LqnCorePackage.MAKING_CALL_TYPE__FANOUT: |
307 | return new Integer(getFanout()); |
308 | } |
309 | return super.eGet(featureID, resolve, coreType); |
310 | } |
311 | |
312 | /** |
313 | * <!-- begin-user-doc --> |
314 | * <!-- end-user-doc --> |
315 | * @generated |
316 | */ |
317 | @SuppressWarnings("unchecked") |
318 | @Override |
319 | public void eSet(int featureID, Object newValue) { |
320 | switch (featureID) { |
321 | case LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL: |
322 | getResultCall().clear(); |
323 | getResultCall().addAll((Collection<? extends OutputResultType>)newValue); |
324 | return; |
325 | case LqnCorePackage.MAKING_CALL_TYPE__DEST: |
326 | setDest((String)newValue); |
327 | return; |
328 | case LqnCorePackage.MAKING_CALL_TYPE__FANIN: |
329 | setFanin(((Integer)newValue).intValue()); |
330 | return; |
331 | case LqnCorePackage.MAKING_CALL_TYPE__FANOUT: |
332 | setFanout(((Integer)newValue).intValue()); |
333 | return; |
334 | } |
335 | super.eSet(featureID, newValue); |
336 | } |
337 | |
338 | /** |
339 | * <!-- begin-user-doc --> |
340 | * <!-- end-user-doc --> |
341 | * @generated |
342 | */ |
343 | @Override |
344 | public void eUnset(int featureID) { |
345 | switch (featureID) { |
346 | case LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL: |
347 | getResultCall().clear(); |
348 | return; |
349 | case LqnCorePackage.MAKING_CALL_TYPE__DEST: |
350 | setDest(DEST_EDEFAULT); |
351 | return; |
352 | case LqnCorePackage.MAKING_CALL_TYPE__FANIN: |
353 | unsetFanin(); |
354 | return; |
355 | case LqnCorePackage.MAKING_CALL_TYPE__FANOUT: |
356 | unsetFanout(); |
357 | return; |
358 | } |
359 | super.eUnset(featureID); |
360 | } |
361 | |
362 | /** |
363 | * <!-- begin-user-doc --> |
364 | * <!-- end-user-doc --> |
365 | * @generated |
366 | */ |
367 | @Override |
368 | public boolean eIsSet(int featureID) { |
369 | switch (featureID) { |
370 | case LqnCorePackage.MAKING_CALL_TYPE__RESULT_CALL: |
371 | return resultCall != null && !resultCall.isEmpty(); |
372 | case LqnCorePackage.MAKING_CALL_TYPE__DEST: |
373 | return DEST_EDEFAULT == null ? dest != null : !DEST_EDEFAULT.equals(dest); |
374 | case LqnCorePackage.MAKING_CALL_TYPE__FANIN: |
375 | return isSetFanin(); |
376 | case LqnCorePackage.MAKING_CALL_TYPE__FANOUT: |
377 | return isSetFanout(); |
378 | } |
379 | return super.eIsSet(featureID); |
380 | } |
381 | |
382 | /** |
383 | * <!-- begin-user-doc --> |
384 | * <!-- end-user-doc --> |
385 | * @generated |
386 | */ |
387 | @Override |
388 | public String toString() { |
389 | if (eIsProxy()) return super.toString(); |
390 | |
391 | StringBuffer result = new StringBuffer(super.toString()); |
392 | result.append(" (dest: "); |
393 | result.append(dest); |
394 | result.append(", fanin: "); |
395 | if (faninESet) result.append(fanin); else result.append("<unset>"); |
396 | result.append(", fanout: "); |
397 | if (fanoutESet) result.append(fanout); else result.append("<unset>"); |
398 | result.append(')'); |
399 | return result.toString(); |
400 | } |
401 | |
402 | } //MakingCallTypeImpl |