Skip to content

Package: AImpl

AImpl

nameinstructionbranchcomplexitylinemethod
AImpl()
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%
basicSetB(B, 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: 5
36%
M: 2 C: 1
33%
M: 2 C: 1
33%
M: 2 C: 2
50%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 17 C: 7
29%
M: 7 C: 2
22%
M: 5 C: 1
17%
M: 2 C: 2
50%
M: 0 C: 1
100%
eSet(int, Object)
M: 15 C: 7
32%
M: 2 C: 1
33%
M: 2 C: 1
33%
M: 5 C: 3
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: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getB()
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%
getBList()
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
setB(B)
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 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.util.EObjectResolvingEList;
25: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.A;
26: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.B;
27: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage;
28:
29: /**
30: * <!-- begin-user-doc -->
31: * An implementation of the model object '<em><b>A</b></em>'.
32: * <!-- end-user-doc -->
33: * <p>
34: * The following features are implemented:
35: * </p>
36: * <ul>
37: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.AImpl#getB <em>B</em>}</li>
38: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.AImpl#getBList
39: * <em>BList</em>}</li>
40: * </ul>
41: *
42: * @generated
43: */
44: public class AImpl extends EImpl implements A {
45:         /**
46:          * The cached value of the '{@link #getB() <em>B</em>}' containment reference.
47:          * <!-- begin-user-doc -->
48:          * <!-- end-user-doc -->
49:          *
50:          * @see #getB()
51:          * @generated
52:          * @ordered
53:          */
54:         protected B b;
55:
56:         /**
57:          * The cached value of the '{@link #getBList() <em>BList</em>}' reference list.
58:          * <!-- begin-user-doc -->
59:          * <!-- end-user-doc -->
60:          *
61:          * @see #getBList()
62:          * @generated
63:          * @ordered
64:          */
65:         protected EList<B> bList;
66:
67:         /**
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @generated
72:          */
73:         protected AImpl() {
74:                 super();
75:         }
76:
77:         /**
78:          * <!-- begin-user-doc -->
79:          * <!-- end-user-doc -->
80:          *
81:          * @generated
82:          */
83:         @Override
84:         protected EClass eStaticClass() {
85:                 return TestPackage.Literals.A;
86:         }
87:
88:         /**
89:          * <!-- begin-user-doc -->
90:          * <!-- end-user-doc -->
91:          *
92:          * @generated
93:          */
94:         @Override
95:         public B getB() {
96:                 return b;
97:         }
98:
99:         /**
100:          * <!-- begin-user-doc -->
101:          * <!-- end-user-doc -->
102:          *
103:          * @generated
104:          */
105:         public NotificationChain basicSetB(B newB, NotificationChain msgs) {
106:                 final B oldB = b;
107:                 b = newB;
108:•                if (eNotificationRequired()) {
109:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TestPackage.A__B, oldB,
110:                                 newB);
111:•                        if (msgs == null) {
112:                                 msgs = notification;
113:                         } else {
114:                                 msgs.add(notification);
115:                         }
116:                 }
117:                 return msgs;
118:         }
119:
120:         /**
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @generated
125:          */
126:         @Override
127:         public void setB(B newB) {
128:•                if (newB != b) {
129:                         NotificationChain msgs = null;
130:•                        if (b != null) {
131:                                 msgs = ((InternalEObject) b).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TestPackage.A__B, null,
132:                                         msgs);
133:                         }
134:•                        if (newB != null) {
135:                                 msgs = ((InternalEObject) newB).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TestPackage.A__B, null,
136:                                         msgs);
137:                         }
138:                         msgs = basicSetB(newB, msgs);
139:•                        if (msgs != null) {
140:                                 msgs.dispatch();
141:                         }
142:•                } else if (eNotificationRequired()) {
143:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.A__B, newB, newB));
144:                 }
145:         }
146:
147:         /**
148:          * <!-- begin-user-doc -->
149:          * <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         @Override
154:         public EList<B> getBList() {
155:•                if (bList == null) {
156:                         bList = new EObjectResolvingEList<>(B.class, this, TestPackage.A__BLIST);
157:                 }
158:                 return bList;
159:         }
160:
161:         /**
162:          * <!-- begin-user-doc -->
163:          * <!-- end-user-doc -->
164:          *
165:          * @generated
166:          */
167:         @Override
168:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
169:•                switch (featureID) {
170:                 case TestPackage.A__B:
171:                         return basicSetB(null, msgs);
172:                 }
173:                 return super.eInverseRemove(otherEnd, featureID, msgs);
174:         }
175:
176:         /**
177:          * <!-- begin-user-doc -->
178:          * <!-- end-user-doc -->
179:          *
180:          * @generated
181:          */
182:         @Override
183:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
184:•                switch (featureID) {
185:                 case TestPackage.A__B:
186:                         return getB();
187:                 case TestPackage.A__BLIST:
188:                         return getBList();
189:                 }
190:                 return super.eGet(featureID, resolve, coreType);
191:         }
192:
193:         /**
194:          * <!-- begin-user-doc -->
195:          * <!-- end-user-doc -->
196:          *
197:          * @generated
198:          */
199:         @SuppressWarnings("unchecked")
200:         @Override
201:         public void eSet(int featureID, Object newValue) {
202:•                switch (featureID) {
203:                 case TestPackage.A__B:
204:                         setB((B) newValue);
205:                         return;
206:                 case TestPackage.A__BLIST:
207:                         getBList().clear();
208:                         getBList().addAll((Collection<? extends B>) newValue);
209:                         return;
210:                 }
211:                 super.eSet(featureID, newValue);
212:         }
213:
214:         /**
215:          * <!-- begin-user-doc -->
216:          * <!-- end-user-doc -->
217:          *
218:          * @generated
219:          */
220:         @Override
221:         public void eUnset(int featureID) {
222:•                switch (featureID) {
223:                 case TestPackage.A__B:
224:                         setB((B) null);
225:                         return;
226:                 case TestPackage.A__BLIST:
227:                         getBList().clear();
228:                         return;
229:                 }
230:                 super.eUnset(featureID);
231:         }
232:
233:         /**
234:          * <!-- begin-user-doc -->
235:          * <!-- end-user-doc -->
236:          *
237:          * @generated
238:          */
239:         @Override
240:         public boolean eIsSet(int featureID) {
241:•                switch (featureID) {
242:                 case TestPackage.A__B:
243:•                        return b != null;
244:                 case TestPackage.A__BLIST:
245:•                        return bList != null && !bList.isEmpty();
246:                 }
247:                 return super.eIsSet(featureID);
248:         }
249:
250: } // AImpl