1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore.impl; |
8 | |
9 | import LqnCore.AsynchCallType; |
10 | import LqnCore.CallListType; |
11 | import LqnCore.LqnCorePackage; |
12 | import LqnCore.SynchCallType; |
13 | |
14 | import java.util.Collection; |
15 | |
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.EObjectImpl; |
24 | |
25 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
26 | import org.eclipse.emf.ecore.util.InternalEList; |
27 | |
28 | /** |
29 | * <!-- begin-user-doc --> |
30 | * An implementation of the model object '<em><b>Call List Type</b></em>'. |
31 | * <!-- end-user-doc --> |
32 | * <p> |
33 | * The following features are implemented: |
34 | * <ul> |
35 | * <li>{@link LqnCore.impl.CallListTypeImpl#getSynchCall <em>Synch Call</em>}</li> |
36 | * <li>{@link LqnCore.impl.CallListTypeImpl#getAsynchCall <em>Asynch Call</em>}</li> |
37 | * </ul> |
38 | * </p> |
39 | * |
40 | * @generated |
41 | */ |
42 | public class CallListTypeImpl extends EObjectImpl implements CallListType { |
43 | /** |
44 | * The cached value of the '{@link #getSynchCall() <em>Synch Call</em>}' containment reference list. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @see #getSynchCall() |
48 | * @generated |
49 | * @ordered |
50 | */ |
51 | protected EList<SynchCallType> synchCall; |
52 | |
53 | /** |
54 | * The cached value of the '{@link #getAsynchCall() <em>Asynch Call</em>}' containment reference list. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @see #getAsynchCall() |
58 | * @generated |
59 | * @ordered |
60 | */ |
61 | protected EList<AsynchCallType> asynchCall; |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | protected CallListTypeImpl() { |
69 | super(); |
70 | } |
71 | |
72 | /** |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | @Override |
78 | protected EClass eStaticClass() { |
79 | return LqnCorePackage.Literals.CALL_LIST_TYPE; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | public EList<SynchCallType> getSynchCall() { |
88 | if (synchCall == null) { |
89 | synchCall = new EObjectContainmentEList<SynchCallType>(SynchCallType.class, this, LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL); |
90 | } |
91 | return synchCall; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public EList<AsynchCallType> getAsynchCall() { |
100 | if (asynchCall == null) { |
101 | asynchCall = new EObjectContainmentEList<AsynchCallType>(AsynchCallType.class, this, LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL); |
102 | } |
103 | return asynchCall; |
104 | } |
105 | |
106 | /** |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | @Override |
112 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
113 | switch (featureID) { |
114 | case LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL: |
115 | return ((InternalEList<?>)getSynchCall()).basicRemove(otherEnd, msgs); |
116 | case LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL: |
117 | return ((InternalEList<?>)getAsynchCall()).basicRemove(otherEnd, msgs); |
118 | } |
119 | return super.eInverseRemove(otherEnd, featureID, msgs); |
120 | } |
121 | |
122 | /** |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | @Override |
128 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
129 | switch (featureID) { |
130 | case LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL: |
131 | return getSynchCall(); |
132 | case LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL: |
133 | return getAsynchCall(); |
134 | } |
135 | return super.eGet(featureID, resolve, coreType); |
136 | } |
137 | |
138 | /** |
139 | * <!-- begin-user-doc --> |
140 | * <!-- end-user-doc --> |
141 | * @generated |
142 | */ |
143 | @SuppressWarnings("unchecked") |
144 | @Override |
145 | public void eSet(int featureID, Object newValue) { |
146 | switch (featureID) { |
147 | case LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL: |
148 | getSynchCall().clear(); |
149 | getSynchCall().addAll((Collection<? extends SynchCallType>)newValue); |
150 | return; |
151 | case LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL: |
152 | getAsynchCall().clear(); |
153 | getAsynchCall().addAll((Collection<? extends AsynchCallType>)newValue); |
154 | return; |
155 | } |
156 | super.eSet(featureID, newValue); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public void eUnset(int featureID) { |
166 | switch (featureID) { |
167 | case LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL: |
168 | getSynchCall().clear(); |
169 | return; |
170 | case LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL: |
171 | getAsynchCall().clear(); |
172 | return; |
173 | } |
174 | super.eUnset(featureID); |
175 | } |
176 | |
177 | /** |
178 | * <!-- begin-user-doc --> |
179 | * <!-- end-user-doc --> |
180 | * @generated |
181 | */ |
182 | @Override |
183 | public boolean eIsSet(int featureID) { |
184 | switch (featureID) { |
185 | case LqnCorePackage.CALL_LIST_TYPE__SYNCH_CALL: |
186 | return synchCall != null && !synchCall.isEmpty(); |
187 | case LqnCorePackage.CALL_LIST_TYPE__ASYNCH_CALL: |
188 | return asynchCall != null && !asynchCall.isEmpty(); |
189 | } |
190 | return super.eIsSet(featureID); |
191 | } |
192 | |
193 | } //CallListTypeImpl |