Skip to content

Package: BImpl

BImpl

nameinstructionbranchcomplexitylinemethod
BImpl()
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%
basicGetE()
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%
basicSetC(C, 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: 9 C: 16
64%
M: 2 C: 5
71%
M: 2 C: 4
67%
M: 2 C: 6
75%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 20 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 30 C: 12
29%
M: 13 C: 4
24%
M: 9 C: 2
18%
M: 3 C: 3
50%
M: 0 C: 1
100%
eSet(int, Object)
M: 30 C: 7
19%
M: 4 C: 1
20%
M: 4 C: 1
20%
M: 10 C: 3
23%
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: 22 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
getC()
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%
getCList()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getE()
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%
getEList()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
setC(C)
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%
setE(E)
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%

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 java.util.Collection;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.common.notify.NotificationChain;
20: import org.eclipse.emf.common.util.EList;
21: import org.eclipse.emf.ecore.EClass;
22: import org.eclipse.emf.ecore.InternalEObject;
23: import org.eclipse.emf.ecore.impl.ENotificationImpl;
24: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
25: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
26: import org.eclipse.emf.ecore.util.EObjectResolvingEList;
27: import org.eclipse.emf.ecore.util.InternalEList;
28: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.B;
29: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.C;
30: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.E;
31: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage;
32:
33: /**
34: * <!-- begin-user-doc -->
35: * An implementation of the model object '<em><b>B</b></em>'.
36: * <!-- end-user-doc -->
37: * <p>
38: * The following features are implemented:
39: * </p>
40: * <ul>
41: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.BImpl#getC <em>C</em>}</li>
42: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.BImpl#getCList
43: * <em>CList</em>}</li>
44: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.BImpl#getEList
45: * <em>EList</em>}</li>
46: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.BImpl#getE <em>E</em>}</li>
47: * </ul>
48: *
49: * @generated
50: */
51: public class BImpl extends MinimalEObjectImpl.Container implements B {
52:         /**
53:          * The cached value of the '{@link #getC() <em>C</em>}' containment reference.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @see #getC()
58:          * @generated
59:          * @ordered
60:          */
61:         protected C c;
62:
63:         /**
64:          * The cached value of the '{@link #getCList() <em>CList</em>}' reference list.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @see #getCList()
69:          * @generated
70:          * @ordered
71:          */
72:         protected EList<C> cList;
73:
74:         /**
75:          * The cached value of the '{@link #getEList() <em>EList</em>}' containment reference list.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @see #getEList()
80:          * @generated
81:          * @ordered
82:          */
83:         protected EList<E> eList;
84:
85:         /**
86:          * The cached value of the '{@link #getE() <em>E</em>}' reference.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @see #getE()
91:          * @generated
92:          * @ordered
93:          */
94:         protected E e;
95:
96:         /**
97:          * <!-- begin-user-doc -->
98:          * <!-- end-user-doc -->
99:          *
100:          * @generated
101:          */
102:         protected BImpl() {
103:                 super();
104:         }
105:
106:         /**
107:          * <!-- begin-user-doc -->
108:          * <!-- end-user-doc -->
109:          *
110:          * @generated
111:          */
112:         @Override
113:         protected EClass eStaticClass() {
114:                 return TestPackage.Literals.B;
115:         }
116:
117:         /**
118:          * <!-- begin-user-doc -->
119:          * <!-- end-user-doc -->
120:          *
121:          * @generated
122:          */
123:         @Override
124:         public C getC() {
125:                 return c;
126:         }
127:
128:         /**
129:          * <!-- begin-user-doc -->
130:          * <!-- end-user-doc -->
131:          *
132:          * @generated
133:          */
134:         public NotificationChain basicSetC(C newC, NotificationChain msgs) {
135:                 final C oldC = c;
136:                 c = newC;
137:•                if (eNotificationRequired()) {
138:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TestPackage.B__C, oldC,
139:                                 newC);
140:•                        if (msgs == null) {
141:                                 msgs = notification;
142:                         } else {
143:                                 msgs.add(notification);
144:                         }
145:                 }
146:                 return msgs;
147:         }
148:
149:         /**
150:          * <!-- begin-user-doc -->
151:          * <!-- end-user-doc -->
152:          *
153:          * @generated
154:          */
155:         @Override
156:         public void setC(C newC) {
157:•                if (newC != c) {
158:                         NotificationChain msgs = null;
159:•                        if (c != null) {
160:                                 msgs = ((InternalEObject) c).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TestPackage.B__C, null,
161:                                         msgs);
162:                         }
163:•                        if (newC != null) {
164:                                 msgs = ((InternalEObject) newC).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TestPackage.B__C, null,
165:                                         msgs);
166:                         }
167:                         msgs = basicSetC(newC, msgs);
168:•                        if (msgs != null) {
169:                                 msgs.dispatch();
170:                         }
171:•                } else if (eNotificationRequired()) {
172:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.B__C, newC, newC));
173:                 }
174:         }
175:
176:         /**
177:          * <!-- begin-user-doc -->
178:          * <!-- end-user-doc -->
179:          *
180:          * @generated
181:          */
182:         @Override
183:         public EList<C> getCList() {
184:•                if (cList == null) {
185:                         cList = new EObjectResolvingEList<>(C.class, this, TestPackage.B__CLIST);
186:                 }
187:                 return cList;
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc -->
192:          * <!-- end-user-doc -->
193:          *
194:          * @generated
195:          */
196:         @Override
197:         public EList<E> getEList() {
198:•                if (eList == null) {
199:                         eList = new EObjectContainmentEList<>(E.class, this, TestPackage.B__ELIST);
200:                 }
201:                 return eList;
202:         }
203:
204:         /**
205:          * <!-- begin-user-doc -->
206:          * <!-- end-user-doc -->
207:          *
208:          * @generated
209:          */
210:         @Override
211:         public E getE() {
212:•                if (e != null && e.eIsProxy()) {
213:                         final InternalEObject oldE = (InternalEObject) e;
214:                         e = (E) eResolveProxy(oldE);
215:•                        if (e != oldE) {
216:•                                if (eNotificationRequired()) {
217:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestPackage.B__E, oldE, e));
218:                                 }
219:                         }
220:                 }
221:                 return e;
222:         }
223:
224:         /**
225:          * <!-- begin-user-doc -->
226:          * <!-- end-user-doc -->
227:          *
228:          * @generated
229:          */
230:         public E basicGetE() {
231:                 return e;
232:         }
233:
234:         /**
235:          * <!-- begin-user-doc -->
236:          * <!-- end-user-doc -->
237:          *
238:          * @generated
239:          */
240:         @Override
241:         public void setE(E newE) {
242:                 final E oldE = e;
243:                 e = newE;
244:•                if (eNotificationRequired()) {
245:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.B__E, oldE, e));
246:                 }
247:         }
248:
249:         /**
250:          * <!-- begin-user-doc -->
251:          * <!-- end-user-doc -->
252:          *
253:          * @generated
254:          */
255:         @Override
256:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
257:•                switch (featureID) {
258:                 case TestPackage.B__C:
259:                         return basicSetC(null, msgs);
260:                 case TestPackage.B__ELIST:
261:                         return ((InternalEList<?>) getEList()).basicRemove(otherEnd, msgs);
262:                 }
263:                 return super.eInverseRemove(otherEnd, featureID, msgs);
264:         }
265:
266:         /**
267:          * <!-- begin-user-doc -->
268:          * <!-- end-user-doc -->
269:          *
270:          * @generated
271:          */
272:         @Override
273:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
274:•                switch (featureID) {
275:                 case TestPackage.B__C:
276:                         return getC();
277:                 case TestPackage.B__CLIST:
278:                         return getCList();
279:                 case TestPackage.B__ELIST:
280:                         return getEList();
281:                 case TestPackage.B__E:
282:•                        if (resolve) {
283:                                 return getE();
284:                         }
285:                         return basicGetE();
286:                 }
287:                 return super.eGet(featureID, resolve, coreType);
288:         }
289:
290:         /**
291:          * <!-- begin-user-doc -->
292:          * <!-- end-user-doc -->
293:          *
294:          * @generated
295:          */
296:         @SuppressWarnings("unchecked")
297:         @Override
298:         public void eSet(int featureID, Object newValue) {
299:•                switch (featureID) {
300:                 case TestPackage.B__C:
301:                         setC((C) newValue);
302:                         return;
303:                 case TestPackage.B__CLIST:
304:                         getCList().clear();
305:                         getCList().addAll((Collection<? extends C>) newValue);
306:                         return;
307:                 case TestPackage.B__ELIST:
308:                         getEList().clear();
309:                         getEList().addAll((Collection<? extends E>) newValue);
310:                         return;
311:                 case TestPackage.B__E:
312:                         setE((E) newValue);
313:                         return;
314:                 }
315:                 super.eSet(featureID, newValue);
316:         }
317:
318:         /**
319:          * <!-- begin-user-doc -->
320:          * <!-- end-user-doc -->
321:          *
322:          * @generated
323:          */
324:         @Override
325:         public void eUnset(int featureID) {
326:•                switch (featureID) {
327:                 case TestPackage.B__C:
328:                         setC((C) null);
329:                         return;
330:                 case TestPackage.B__CLIST:
331:                         getCList().clear();
332:                         return;
333:                 case TestPackage.B__ELIST:
334:                         getEList().clear();
335:                         return;
336:                 case TestPackage.B__E:
337:                         setE((E) null);
338:                         return;
339:                 }
340:                 super.eUnset(featureID);
341:         }
342:
343:         /**
344:          * <!-- begin-user-doc -->
345:          * <!-- end-user-doc -->
346:          *
347:          * @generated
348:          */
349:         @Override
350:         public boolean eIsSet(int featureID) {
351:•                switch (featureID) {
352:                 case TestPackage.B__C:
353:•                        return c != null;
354:                 case TestPackage.B__CLIST:
355:•                        return cList != null && !cList.isEmpty();
356:                 case TestPackage.B__ELIST:
357:•                        return eList != null && !eList.isEmpty();
358:                 case TestPackage.B__E:
359:•                        return e != null;
360:                 }
361:                 return super.eIsSet(featureID);
362:         }
363:
364: } // BImpl