Skip to content

Package: CImpl

CImpl

nameinstructionbranchcomplexitylinemethod
CImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
basicGetA()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
basicSetD(D, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 6 C: 4
40%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 26 C: 20
43%
M: 7 C: 7
50%
M: 6 C: 4
40%
M: 7 C: 8
53%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 34 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 25 C: 28
53%
M: 12 C: 10
45%
M: 9 C: 5
36%
M: 2 C: 5
71%
M: 0 C: 1
100%
eSet(int, Object)
M: 23 C: 12
34%
M: 4 C: 2
33%
M: 4 C: 2
33%
M: 8 C: 5
38%
M: 0 C: 1
100%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 26 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
getA()
M: 28 C: 10
26%
M: 5 C: 3
38%
M: 3 C: 2
40%
M: 5 C: 2
29%
M: 0 C: 1
100%
getD()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getEClassToA()
M: 0 C: 15
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getEClassToE()
M: 0 C: 15
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getEClassToString()
M: 0 C: 15
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 4
100%
M: 0 C: 1
100%
setA(A)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 4
80%
M: 0 C: 1
100%
setD(D)
M: 25 C: 27
52%
M: 6 C: 4
40%
M: 5 C: 1
17%
M: 5 C: 9
64%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Lucas Koehler - initial API and implementation
13: */
14: package org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.common.notify.NotificationChain;
18: import org.eclipse.emf.common.util.EMap;
19: import org.eclipse.emf.ecore.EClass;
20: import org.eclipse.emf.ecore.EStructuralFeature;
21: import org.eclipse.emf.ecore.InternalEObject;
22: import org.eclipse.emf.ecore.impl.ENotificationImpl;
23: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
24: import org.eclipse.emf.ecore.util.EcoreEMap;
25: import org.eclipse.emf.ecore.util.InternalEList;
26: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.A;
27: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.C;
28: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.D;
29: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.E;
30: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage;
31:
32: /**
33: * <!-- begin-user-doc -->
34: * An implementation of the model object '<em><b>C</b></em>'.
35: * <!-- end-user-doc -->
36: * <p>
37: * The following features are implemented:
38: * </p>
39: * <ul>
40: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.CImpl#getD <em>D</em>}</li>
41: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.CImpl#getEClassToString
42: * <em>EClass To String</em>}</li>
43: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.CImpl#getEClassToA <em>EClass To
44: * A</em>}</li>
45: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.CImpl#getA <em>A</em>}</li>
46: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.CImpl#getEClassToE <em>EClass To
47: * E</em>}</li>
48: * </ul>
49: *
50: * @generated
51: */
52: public class CImpl extends MinimalEObjectImpl.Container implements C {
53:         /**
54:          * The cached value of the '{@link #getD() <em>D</em>}' containment reference.
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @see #getD()
59:          * @generated
60:          * @ordered
61:          */
62:         protected D d;
63:
64:         /**
65:          * The cached value of the '{@link #getEClassToString() <em>EClass To String</em>}' map.
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @see #getEClassToString()
70:          * @generated
71:          * @ordered
72:          */
73:         protected EMap<EClass, String> eClassToString;
74:
75:         /**
76:          * The cached value of the '{@link #getEClassToA() <em>EClass To A</em>}' map.
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @see #getEClassToA()
81:          * @generated
82:          * @ordered
83:          */
84:         protected EMap<EClass, A> eClassToA;
85:
86:         /**
87:          * The cached value of the '{@link #getA() <em>A</em>}' reference.
88:          * <!-- begin-user-doc -->
89:          * <!-- end-user-doc -->
90:          *
91:          * @see #getA()
92:          * @generated
93:          * @ordered
94:          */
95:         protected A a;
96:
97:         /**
98:          * The cached value of the '{@link #getEClassToE() <em>EClass To E</em>}' map.
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @see #getEClassToE()
103:          * @generated
104:          * @ordered
105:          */
106:         protected EMap<EClass, E> eClassToE;
107:
108:         /**
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         protected CImpl() {
115:                 super();
116:         }
117:
118:         /**
119:          * <!-- begin-user-doc -->
120:          * <!-- end-user-doc -->
121:          *
122:          * @generated
123:          */
124:         @Override
125:         protected EClass eStaticClass() {
126:                 return TestPackage.Literals.C;
127:         }
128:
129:         /**
130:          * <!-- begin-user-doc -->
131:          * <!-- end-user-doc -->
132:          *
133:          * @generated
134:          */
135:         @Override
136:         public D getD() {
137:                 return d;
138:         }
139:
140:         /**
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @generated
145:          */
146:         public NotificationChain basicSetD(D newD, NotificationChain msgs) {
147:                 final D oldD = d;
148:                 d = newD;
149:•                if (eNotificationRequired()) {
150:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TestPackage.C__D, oldD,
151:                                 newD);
152:•                        if (msgs == null) {
153:                                 msgs = notification;
154:                         } else {
155:                                 msgs.add(notification);
156:                         }
157:                 }
158:                 return msgs;
159:         }
160:
161:         /**
162:          * <!-- begin-user-doc -->
163:          * <!-- end-user-doc -->
164:          *
165:          * @generated
166:          */
167:         @Override
168:         public void setD(D newD) {
169:•                if (newD != d) {
170:                         NotificationChain msgs = null;
171:•                        if (d != null) {
172:                                 msgs = ((InternalEObject) d).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TestPackage.C__D, null,
173:                                         msgs);
174:                         }
175:•                        if (newD != null) {
176:                                 msgs = ((InternalEObject) newD).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TestPackage.C__D, null,
177:                                         msgs);
178:                         }
179:                         msgs = basicSetD(newD, msgs);
180:•                        if (msgs != null) {
181:                                 msgs.dispatch();
182:                         }
183:•                } else if (eNotificationRequired()) {
184:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.C__D, newD, newD));
185:                 }
186:         }
187:
188:         /**
189:          * <!-- begin-user-doc -->
190:          * <!-- end-user-doc -->
191:          *
192:          * @generated
193:          */
194:         @Override
195:         public EMap<EClass, String> getEClassToString() {
196:•                if (eClassToString == null) {
197:                         eClassToString = new EcoreEMap<>(TestPackage.Literals.ECLASS_TO_ESTRING_MAP,
198:                                 EClassToEStringMapImpl.class, this, TestPackage.C__ECLASS_TO_STRING);
199:                 }
200:                 return eClassToString;
201:         }
202:
203:         /**
204:          * <!-- begin-user-doc -->
205:          * <!-- end-user-doc -->
206:          *
207:          * @generated
208:          */
209:         @Override
210:         public EMap<EClass, A> getEClassToA() {
211:•                if (eClassToA == null) {
212:                         eClassToA = new EcoreEMap<>(TestPackage.Literals.ECLASS_TO_AMAP, EClassToAMapImpl.class, this,
213:                                 TestPackage.C__ECLASS_TO_A);
214:                 }
215:                 return eClassToA;
216:         }
217:
218:         /**
219:          * <!-- begin-user-doc -->
220:          * <!-- end-user-doc -->
221:          *
222:          * @generated
223:          */
224:         @Override
225:         public A getA() {
226:•                if (a != null && a.eIsProxy()) {
227:                         final InternalEObject oldA = (InternalEObject) a;
228:                         a = (A) eResolveProxy(oldA);
229:•                        if (a != oldA) {
230:•                                if (eNotificationRequired()) {
231:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestPackage.C__A, oldA, a));
232:                                 }
233:                         }
234:                 }
235:                 return a;
236:         }
237:
238:         /**
239:          * <!-- begin-user-doc -->
240:          * <!-- end-user-doc -->
241:          *
242:          * @generated
243:          */
244:         public A basicGetA() {
245:                 return a;
246:         }
247:
248:         /**
249:          * <!-- begin-user-doc -->
250:          * <!-- end-user-doc -->
251:          *
252:          * @generated
253:          */
254:         @Override
255:         public void setA(A newA) {
256:                 final A oldA = a;
257:                 a = newA;
258:•                if (eNotificationRequired()) {
259:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.C__A, oldA, a));
260:                 }
261:         }
262:
263:         /**
264:          * <!-- begin-user-doc -->
265:          * <!-- end-user-doc -->
266:          *
267:          * @generated
268:          */
269:         @Override
270:         public EMap<EClass, E> getEClassToE() {
271:•                if (eClassToE == null) {
272:                         eClassToE = new EcoreEMap<>(TestPackage.Literals.ECLASS_TO_EMAP, EClassToEMapImpl.class, this,
273:                                 TestPackage.C__ECLASS_TO_E);
274:                 }
275:                 return eClassToE;
276:         }
277:
278:         /**
279:          * <!-- begin-user-doc -->
280:          * <!-- end-user-doc -->
281:          *
282:          * @generated
283:          */
284:         @Override
285:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
286:•                switch (featureID) {
287:                 case TestPackage.C__D:
288:                         return basicSetD(null, msgs);
289:                 case TestPackage.C__ECLASS_TO_STRING:
290:                         return ((InternalEList<?>) getEClassToString()).basicRemove(otherEnd, msgs);
291:                 case TestPackage.C__ECLASS_TO_A:
292:                         return ((InternalEList<?>) getEClassToA()).basicRemove(otherEnd, msgs);
293:                 case TestPackage.C__ECLASS_TO_E:
294:                         return ((InternalEList<?>) getEClassToE()).basicRemove(otherEnd, msgs);
295:                 }
296:                 return super.eInverseRemove(otherEnd, featureID, msgs);
297:         }
298:
299:         /**
300:          * <!-- begin-user-doc -->
301:          * <!-- end-user-doc -->
302:          *
303:          * @generated
304:          */
305:         @Override
306:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
307:•                switch (featureID) {
308:                 case TestPackage.C__D:
309:                         return getD();
310:                 case TestPackage.C__ECLASS_TO_STRING:
311:•                        if (coreType) {
312:                                 return getEClassToString();
313:                         }
314:                         return getEClassToString().map();
315:                 case TestPackage.C__ECLASS_TO_A:
316:•                        if (coreType) {
317:                                 return getEClassToA();
318:                         }
319:                         return getEClassToA().map();
320:                 case TestPackage.C__A:
321:•                        if (resolve) {
322:                                 return getA();
323:                         }
324:                         return basicGetA();
325:                 case TestPackage.C__ECLASS_TO_E:
326:•                        if (coreType) {
327:                                 return getEClassToE();
328:                         }
329:                         return getEClassToE().map();
330:                 }
331:                 return super.eGet(featureID, resolve, coreType);
332:         }
333:
334:         /**
335:          * <!-- begin-user-doc -->
336:          * <!-- end-user-doc -->
337:          *
338:          * @generated
339:          */
340:         @Override
341:         public void eSet(int featureID, Object newValue) {
342:•                switch (featureID) {
343:                 case TestPackage.C__D:
344:                         setD((D) newValue);
345:                         return;
346:                 case TestPackage.C__ECLASS_TO_STRING:
347:                         ((EStructuralFeature.Setting) getEClassToString()).set(newValue);
348:                         return;
349:                 case TestPackage.C__ECLASS_TO_A:
350:                         ((EStructuralFeature.Setting) getEClassToA()).set(newValue);
351:                         return;
352:                 case TestPackage.C__A:
353:                         setA((A) newValue);
354:                         return;
355:                 case TestPackage.C__ECLASS_TO_E:
356:                         ((EStructuralFeature.Setting) getEClassToE()).set(newValue);
357:                         return;
358:                 }
359:                 super.eSet(featureID, newValue);
360:         }
361:
362:         /**
363:          * <!-- begin-user-doc -->
364:          * <!-- end-user-doc -->
365:          *
366:          * @generated
367:          */
368:         @Override
369:         public void eUnset(int featureID) {
370:•                switch (featureID) {
371:                 case TestPackage.C__D:
372:                         setD((D) null);
373:                         return;
374:                 case TestPackage.C__ECLASS_TO_STRING:
375:                         getEClassToString().clear();
376:                         return;
377:                 case TestPackage.C__ECLASS_TO_A:
378:                         getEClassToA().clear();
379:                         return;
380:                 case TestPackage.C__A:
381:                         setA((A) null);
382:                         return;
383:                 case TestPackage.C__ECLASS_TO_E:
384:                         getEClassToE().clear();
385:                         return;
386:                 }
387:                 super.eUnset(featureID);
388:         }
389:
390:         /**
391:          * <!-- begin-user-doc -->
392:          * <!-- end-user-doc -->
393:          *
394:          * @generated
395:          */
396:         @Override
397:         public boolean eIsSet(int featureID) {
398:•                switch (featureID) {
399:                 case TestPackage.C__D:
400:•                        return d != null;
401:                 case TestPackage.C__ECLASS_TO_STRING:
402:•                        return eClassToString != null && !eClassToString.isEmpty();
403:                 case TestPackage.C__ECLASS_TO_A:
404:•                        return eClassToA != null && !eClassToA.isEmpty();
405:                 case TestPackage.C__A:
406:•                        return a != null;
407:                 case TestPackage.C__ECLASS_TO_E:
408:•                        return eClassToE != null && !eClassToE.isEmpty();
409:                 }
410:                 return super.eIsSet(featureID);
411:         }
412:
413: } // CImpl