1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.cpdp.decentApp.models.arffx.impl;
|
---|
4 |
|
---|
5 | import java.util.Collection;
|
---|
6 |
|
---|
7 | import org.eclipse.emf.common.notify.Notification;
|
---|
8 | import org.eclipse.emf.common.notify.NotificationChain;
|
---|
9 | import org.eclipse.emf.common.util.EList;
|
---|
10 | import org.eclipse.emf.common.util.EMap;
|
---|
11 | import org.eclipse.emf.ecore.EClass;
|
---|
12 | import org.eclipse.emf.ecore.EStructuralFeature;
|
---|
13 | import org.eclipse.emf.ecore.InternalEObject;
|
---|
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
---|
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
16 | import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
---|
17 | import org.eclipse.emf.ecore.util.EcoreEMap;
|
---|
18 | import org.eclipse.emf.ecore.util.InternalEList;
|
---|
19 |
|
---|
20 | import de.ugoe.cs.cpdp.decentApp.models.arffx.ARFFxPackage;
|
---|
21 | import de.ugoe.cs.cpdp.decentApp.models.arffx.Attribute;
|
---|
22 | import de.ugoe.cs.cpdp.decentApp.models.arffx.Dimension;
|
---|
23 | import de.ugoe.cs.cpdp.decentApp.models.arffx.Instance;
|
---|
24 | import de.ugoe.cs.cpdp.decentApp.models.arffx.Model;
|
---|
25 | import de.ugoe.cs.cpdp.decentApp.models.arffx.Type;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * <!-- begin-user-doc -->
|
---|
29 | * An implementation of the model object '<em><b>Model</b></em>'.
|
---|
30 | * <!-- end-user-doc -->
|
---|
31 | * <p>
|
---|
32 | * The following features are implemented:
|
---|
33 | * <ul>
|
---|
34 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getName <em>Name</em>}</li>
|
---|
35 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getMeta <em>Meta</em>}</li>
|
---|
36 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getAttributes <em>Attributes</em>}</li>
|
---|
37 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getData <em>Data</em>}</li>
|
---|
38 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getDimensions <em>Dimensions</em>}</li>
|
---|
39 | * <li>{@link de.ugoe.cs.cpdp.decentApp.models.arffx.impl.ModelImpl#getTypes <em>Types</em>}</li>
|
---|
40 | * </ul>
|
---|
41 | * </p>
|
---|
42 | *
|
---|
43 | * @generated
|
---|
44 | */
|
---|
45 | public class ModelImpl extends MinimalEObjectImpl.Container implements Model {
|
---|
46 | /**
|
---|
47 | * The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
---|
48 | * <!-- begin-user-doc -->
|
---|
49 | * <!-- end-user-doc -->
|
---|
50 | * @see #getName()
|
---|
51 | * @generated
|
---|
52 | * @ordered
|
---|
53 | */
|
---|
54 | protected static final String NAME_EDEFAULT = null;
|
---|
55 |
|
---|
56 | /**
|
---|
57 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
---|
58 | * <!-- begin-user-doc -->
|
---|
59 | * <!-- end-user-doc -->
|
---|
60 | * @see #getName()
|
---|
61 | * @generated
|
---|
62 | * @ordered
|
---|
63 | */
|
---|
64 | protected String name = NAME_EDEFAULT;
|
---|
65 |
|
---|
66 | /**
|
---|
67 | * The cached value of the '{@link #getMeta() <em>Meta</em>}' map.
|
---|
68 | * <!-- begin-user-doc -->
|
---|
69 | * <!-- end-user-doc -->
|
---|
70 | * @see #getMeta()
|
---|
71 | * @generated
|
---|
72 | * @ordered
|
---|
73 | */
|
---|
74 | protected EMap<String, String> meta;
|
---|
75 |
|
---|
76 | /**
|
---|
77 | * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
|
---|
78 | * <!-- begin-user-doc -->
|
---|
79 | * <!-- end-user-doc -->
|
---|
80 | * @see #getAttributes()
|
---|
81 | * @generated
|
---|
82 | * @ordered
|
---|
83 | */
|
---|
84 | protected EList<Attribute> attributes;
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * The cached value of the '{@link #getData() <em>Data</em>}' containment reference list.
|
---|
88 | * <!-- begin-user-doc -->
|
---|
89 | * <!-- end-user-doc -->
|
---|
90 | * @see #getData()
|
---|
91 | * @generated
|
---|
92 | * @ordered
|
---|
93 | */
|
---|
94 | protected EList<Instance> data;
|
---|
95 |
|
---|
96 | /**
|
---|
97 | * The cached value of the '{@link #getDimensions() <em>Dimensions</em>}' containment reference list.
|
---|
98 | * <!-- begin-user-doc -->
|
---|
99 | * <!-- end-user-doc -->
|
---|
100 | * @see #getDimensions()
|
---|
101 | * @generated
|
---|
102 | * @ordered
|
---|
103 | */
|
---|
104 | protected EList<Dimension> dimensions;
|
---|
105 |
|
---|
106 | /**
|
---|
107 | * The cached value of the '{@link #getTypes() <em>Types</em>}' containment reference list.
|
---|
108 | * <!-- begin-user-doc -->
|
---|
109 | * <!-- end-user-doc -->
|
---|
110 | * @see #getTypes()
|
---|
111 | * @generated
|
---|
112 | * @ordered
|
---|
113 | */
|
---|
114 | protected EList<Type> types;
|
---|
115 |
|
---|
116 | /**
|
---|
117 | * <!-- begin-user-doc -->
|
---|
118 | * <!-- end-user-doc -->
|
---|
119 | * @generated
|
---|
120 | */
|
---|
121 | protected ModelImpl() {
|
---|
122 | super();
|
---|
123 | }
|
---|
124 |
|
---|
125 | /**
|
---|
126 | * <!-- begin-user-doc -->
|
---|
127 | * <!-- end-user-doc -->
|
---|
128 | * @generated
|
---|
129 | */
|
---|
130 | @Override
|
---|
131 | protected EClass eStaticClass() {
|
---|
132 | return ARFFxPackage.Literals.MODEL;
|
---|
133 | }
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * <!-- begin-user-doc -->
|
---|
137 | * <!-- end-user-doc -->
|
---|
138 | * @generated
|
---|
139 | */
|
---|
140 | public String getName() {
|
---|
141 | return name;
|
---|
142 | }
|
---|
143 |
|
---|
144 | /**
|
---|
145 | * <!-- begin-user-doc -->
|
---|
146 | * <!-- end-user-doc -->
|
---|
147 | * @generated
|
---|
148 | */
|
---|
149 | public void setName(String newName) {
|
---|
150 | String oldName = name;
|
---|
151 | name = newName;
|
---|
152 | if (eNotificationRequired())
|
---|
153 | eNotify(new ENotificationImpl(this, Notification.SET, ARFFxPackage.MODEL__NAME, oldName, name));
|
---|
154 | }
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * <!-- begin-user-doc -->
|
---|
158 | * <!-- end-user-doc -->
|
---|
159 | * @generated
|
---|
160 | */
|
---|
161 | public EMap<String, String> getMeta() {
|
---|
162 | if (meta == null) {
|
---|
163 | meta = new EcoreEMap<String,String>(ARFFxPackage.Literals.META_DATA, MetaDataImpl.class, this, ARFFxPackage.MODEL__META);
|
---|
164 | }
|
---|
165 | return meta;
|
---|
166 | }
|
---|
167 |
|
---|
168 | /**
|
---|
169 | * <!-- begin-user-doc -->
|
---|
170 | * <!-- end-user-doc -->
|
---|
171 | * @generated
|
---|
172 | */
|
---|
173 | public EList<Attribute> getAttributes() {
|
---|
174 | if (attributes == null) {
|
---|
175 | attributes = new EObjectContainmentEList<Attribute>(Attribute.class, this, ARFFxPackage.MODEL__ATTRIBUTES);
|
---|
176 | }
|
---|
177 | return attributes;
|
---|
178 | }
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * <!-- begin-user-doc -->
|
---|
182 | * <!-- end-user-doc -->
|
---|
183 | * @generated
|
---|
184 | */
|
---|
185 | public EList<Instance> getData() {
|
---|
186 | if (data == null) {
|
---|
187 | data = new EObjectContainmentEList<Instance>(Instance.class, this, ARFFxPackage.MODEL__DATA);
|
---|
188 | }
|
---|
189 | return data;
|
---|
190 | }
|
---|
191 |
|
---|
192 | /**
|
---|
193 | * <!-- begin-user-doc -->
|
---|
194 | * <!-- end-user-doc -->
|
---|
195 | * @generated
|
---|
196 | */
|
---|
197 | public EList<Dimension> getDimensions() {
|
---|
198 | if (dimensions == null) {
|
---|
199 | dimensions = new EObjectContainmentEList<Dimension>(Dimension.class, this, ARFFxPackage.MODEL__DIMENSIONS);
|
---|
200 | }
|
---|
201 | return dimensions;
|
---|
202 | }
|
---|
203 |
|
---|
204 | /**
|
---|
205 | * <!-- begin-user-doc -->
|
---|
206 | * <!-- end-user-doc -->
|
---|
207 | * @generated
|
---|
208 | */
|
---|
209 | public EList<Type> getTypes() {
|
---|
210 | if (types == null) {
|
---|
211 | types = new EObjectContainmentEList<Type>(Type.class, this, ARFFxPackage.MODEL__TYPES);
|
---|
212 | }
|
---|
213 | return types;
|
---|
214 | }
|
---|
215 |
|
---|
216 | /**
|
---|
217 | * <!-- begin-user-doc -->
|
---|
218 | * <!-- end-user-doc -->
|
---|
219 | * @generated
|
---|
220 | */
|
---|
221 | @Override
|
---|
222 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
---|
223 | switch (featureID) {
|
---|
224 | case ARFFxPackage.MODEL__META:
|
---|
225 | return ((InternalEList<?>)getMeta()).basicRemove(otherEnd, msgs);
|
---|
226 | case ARFFxPackage.MODEL__ATTRIBUTES:
|
---|
227 | return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
|
---|
228 | case ARFFxPackage.MODEL__DATA:
|
---|
229 | return ((InternalEList<?>)getData()).basicRemove(otherEnd, msgs);
|
---|
230 | case ARFFxPackage.MODEL__DIMENSIONS:
|
---|
231 | return ((InternalEList<?>)getDimensions()).basicRemove(otherEnd, msgs);
|
---|
232 | case ARFFxPackage.MODEL__TYPES:
|
---|
233 | return ((InternalEList<?>)getTypes()).basicRemove(otherEnd, msgs);
|
---|
234 | }
|
---|
235 | return super.eInverseRemove(otherEnd, featureID, msgs);
|
---|
236 | }
|
---|
237 |
|
---|
238 | /**
|
---|
239 | * <!-- begin-user-doc -->
|
---|
240 | * <!-- end-user-doc -->
|
---|
241 | * @generated
|
---|
242 | */
|
---|
243 | @Override
|
---|
244 | public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
---|
245 | switch (featureID) {
|
---|
246 | case ARFFxPackage.MODEL__NAME:
|
---|
247 | return getName();
|
---|
248 | case ARFFxPackage.MODEL__META:
|
---|
249 | if (coreType) return getMeta();
|
---|
250 | else return getMeta().map();
|
---|
251 | case ARFFxPackage.MODEL__ATTRIBUTES:
|
---|
252 | return getAttributes();
|
---|
253 | case ARFFxPackage.MODEL__DATA:
|
---|
254 | return getData();
|
---|
255 | case ARFFxPackage.MODEL__DIMENSIONS:
|
---|
256 | return getDimensions();
|
---|
257 | case ARFFxPackage.MODEL__TYPES:
|
---|
258 | return getTypes();
|
---|
259 | }
|
---|
260 | return super.eGet(featureID, resolve, coreType);
|
---|
261 | }
|
---|
262 |
|
---|
263 | /**
|
---|
264 | * <!-- begin-user-doc -->
|
---|
265 | * <!-- end-user-doc -->
|
---|
266 | * @generated
|
---|
267 | */
|
---|
268 | @SuppressWarnings("unchecked")
|
---|
269 | @Override
|
---|
270 | public void eSet(int featureID, Object newValue) {
|
---|
271 | switch (featureID) {
|
---|
272 | case ARFFxPackage.MODEL__NAME:
|
---|
273 | setName((String)newValue);
|
---|
274 | return;
|
---|
275 | case ARFFxPackage.MODEL__META:
|
---|
276 | ((EStructuralFeature.Setting)getMeta()).set(newValue);
|
---|
277 | return;
|
---|
278 | case ARFFxPackage.MODEL__ATTRIBUTES:
|
---|
279 | getAttributes().clear();
|
---|
280 | getAttributes().addAll((Collection<? extends Attribute>)newValue);
|
---|
281 | return;
|
---|
282 | case ARFFxPackage.MODEL__DATA:
|
---|
283 | getData().clear();
|
---|
284 | getData().addAll((Collection<? extends Instance>)newValue);
|
---|
285 | return;
|
---|
286 | case ARFFxPackage.MODEL__DIMENSIONS:
|
---|
287 | getDimensions().clear();
|
---|
288 | getDimensions().addAll((Collection<? extends Dimension>)newValue);
|
---|
289 | return;
|
---|
290 | case ARFFxPackage.MODEL__TYPES:
|
---|
291 | getTypes().clear();
|
---|
292 | getTypes().addAll((Collection<? extends Type>)newValue);
|
---|
293 | return;
|
---|
294 | }
|
---|
295 | super.eSet(featureID, newValue);
|
---|
296 | }
|
---|
297 |
|
---|
298 | /**
|
---|
299 | * <!-- begin-user-doc -->
|
---|
300 | * <!-- end-user-doc -->
|
---|
301 | * @generated
|
---|
302 | */
|
---|
303 | @Override
|
---|
304 | public void eUnset(int featureID) {
|
---|
305 | switch (featureID) {
|
---|
306 | case ARFFxPackage.MODEL__NAME:
|
---|
307 | setName(NAME_EDEFAULT);
|
---|
308 | return;
|
---|
309 | case ARFFxPackage.MODEL__META:
|
---|
310 | getMeta().clear();
|
---|
311 | return;
|
---|
312 | case ARFFxPackage.MODEL__ATTRIBUTES:
|
---|
313 | getAttributes().clear();
|
---|
314 | return;
|
---|
315 | case ARFFxPackage.MODEL__DATA:
|
---|
316 | getData().clear();
|
---|
317 | return;
|
---|
318 | case ARFFxPackage.MODEL__DIMENSIONS:
|
---|
319 | getDimensions().clear();
|
---|
320 | return;
|
---|
321 | case ARFFxPackage.MODEL__TYPES:
|
---|
322 | getTypes().clear();
|
---|
323 | return;
|
---|
324 | }
|
---|
325 | super.eUnset(featureID);
|
---|
326 | }
|
---|
327 |
|
---|
328 | /**
|
---|
329 | * <!-- begin-user-doc -->
|
---|
330 | * <!-- end-user-doc -->
|
---|
331 | * @generated
|
---|
332 | */
|
---|
333 | @Override
|
---|
334 | public boolean eIsSet(int featureID) {
|
---|
335 | switch (featureID) {
|
---|
336 | case ARFFxPackage.MODEL__NAME:
|
---|
337 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
---|
338 | case ARFFxPackage.MODEL__META:
|
---|
339 | return meta != null && !meta.isEmpty();
|
---|
340 | case ARFFxPackage.MODEL__ATTRIBUTES:
|
---|
341 | return attributes != null && !attributes.isEmpty();
|
---|
342 | case ARFFxPackage.MODEL__DATA:
|
---|
343 | return data != null && !data.isEmpty();
|
---|
344 | case ARFFxPackage.MODEL__DIMENSIONS:
|
---|
345 | return dimensions != null && !dimensions.isEmpty();
|
---|
346 | case ARFFxPackage.MODEL__TYPES:
|
---|
347 | return types != null && !types.isEmpty();
|
---|
348 | }
|
---|
349 | return super.eIsSet(featureID);
|
---|
350 | }
|
---|
351 |
|
---|
352 | /**
|
---|
353 | * <!-- begin-user-doc -->
|
---|
354 | * <!-- end-user-doc -->
|
---|
355 | * @generated
|
---|
356 | */
|
---|
357 | @Override
|
---|
358 | public String toString() {
|
---|
359 | if (eIsProxy()) return super.toString();
|
---|
360 |
|
---|
361 | StringBuffer result = new StringBuffer(super.toString());
|
---|
362 | result.append(" (name: ");
|
---|
363 | result.append(name);
|
---|
364 | result.append(')');
|
---|
365 | return result.toString();
|
---|
366 | }
|
---|
367 |
|
---|
368 | } //ModelImpl
|
---|