1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore.impl; |
8 | |
9 | import LqnCore.LqnCorePackage; |
10 | import LqnCore.LqnCoreType; |
11 | import LqnCore.ProcessorType; |
12 | import LqnCore.SlotType; |
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>Type</b></em>'. |
31 | * <!-- end-user-doc --> |
32 | * <p> |
33 | * The following features are implemented: |
34 | * <ul> |
35 | * <li>{@link LqnCore.impl.LqnCoreTypeImpl#getProcessor <em>Processor</em>}</li> |
36 | * <li>{@link LqnCore.impl.LqnCoreTypeImpl#getSlot <em>Slot</em>}</li> |
37 | * </ul> |
38 | * </p> |
39 | * |
40 | * @generated |
41 | */ |
42 | public class LqnCoreTypeImpl extends EObjectImpl implements LqnCoreType { |
43 | /** |
44 | * The cached value of the '{@link #getProcessor() <em>Processor</em>}' containment reference list. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @see #getProcessor() |
48 | * @generated |
49 | * @ordered |
50 | */ |
51 | protected EList<ProcessorType> processor; |
52 | |
53 | /** |
54 | * The cached value of the '{@link #getSlot() <em>Slot</em>}' containment reference list. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @see #getSlot() |
58 | * @generated |
59 | * @ordered |
60 | */ |
61 | protected EList<SlotType> slot; |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | protected LqnCoreTypeImpl() { |
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.LQN_CORE_TYPE; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | public EList<ProcessorType> getProcessor() { |
88 | if (processor == null) { |
89 | processor = new EObjectContainmentEList<ProcessorType>(ProcessorType.class, this, LqnCorePackage.LQN_CORE_TYPE__PROCESSOR); |
90 | } |
91 | return processor; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public EList<SlotType> getSlot() { |
100 | if (slot == null) { |
101 | slot = new EObjectContainmentEList<SlotType>(SlotType.class, this, LqnCorePackage.LQN_CORE_TYPE__SLOT); |
102 | } |
103 | return slot; |
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.LQN_CORE_TYPE__PROCESSOR: |
115 | return ((InternalEList<?>)getProcessor()).basicRemove(otherEnd, msgs); |
116 | case LqnCorePackage.LQN_CORE_TYPE__SLOT: |
117 | return ((InternalEList<?>)getSlot()).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.LQN_CORE_TYPE__PROCESSOR: |
131 | return getProcessor(); |
132 | case LqnCorePackage.LQN_CORE_TYPE__SLOT: |
133 | return getSlot(); |
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.LQN_CORE_TYPE__PROCESSOR: |
148 | getProcessor().clear(); |
149 | getProcessor().addAll((Collection<? extends ProcessorType>)newValue); |
150 | return; |
151 | case LqnCorePackage.LQN_CORE_TYPE__SLOT: |
152 | getSlot().clear(); |
153 | getSlot().addAll((Collection<? extends SlotType>)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.LQN_CORE_TYPE__PROCESSOR: |
168 | getProcessor().clear(); |
169 | return; |
170 | case LqnCorePackage.LQN_CORE_TYPE__SLOT: |
171 | getSlot().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.LQN_CORE_TYPE__PROCESSOR: |
186 | return processor != null && !processor.isEmpty(); |
187 | case LqnCorePackage.LQN_CORE_TYPE__SLOT: |
188 | return slot != null && !slot.isEmpty(); |
189 | } |
190 | return super.eIsSet(featureID); |
191 | } |
192 | |
193 | } //LqnCoreTypeImpl |