Skip to content

Package: EClassToAMapImpl

EClassToAMapImpl

nameinstructionbranchcomplexitylinemethod
EClassToAMapImpl()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
basicGetTypedKey()
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%
basicGetTypedValue()
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%
eGet(int, boolean, boolean)
M: 17 C: 7
29%
M: 5 C: 2
29%
M: 4 C: 1
20%
M: 5 C: 3
38%
M: 0 C: 1
100%
eIsSet(int)
M: 13 C: 7
35%
M: 5 C: 2
29%
M: 4 C: 1
20%
M: 2 C: 2
50%
M: 0 C: 1
100%
eSet(int, Object)
M: 17 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
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%
getEMap()
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getHash()
M: 11 C: 7
39%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 2 C: 2
50%
M: 0 C: 1
100%
getKey()
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%
getTypedKey()
M: 28 C: 10
26%
M: 6 C: 2
25%
M: 4 C: 1
20%
M: 6 C: 2
25%
M: 0 C: 1
100%
getTypedValue()
M: 28 C: 10
26%
M: 5 C: 3
38%
M: 3 C: 2
40%
M: 6 C: 2
25%
M: 0 C: 1
100%
getValue()
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%
setHash(int)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setKey(EClass)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setTypedKey(EClass)
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%
setTypedValue(A)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
setValue(A)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
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.util.BasicEMap;
18: import org.eclipse.emf.common.util.EMap;
19: import org.eclipse.emf.ecore.EClass;
20: import org.eclipse.emf.ecore.EObject;
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.emfforms.core.services.databinding.testmodel.test.model.A;
25: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>EClass To AMap</b></em>'.
30: * <!-- end-user-doc -->
31: * <p>
32: * The following features are implemented:
33: * </p>
34: * <ul>
35: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.EClassToAMapImpl#getTypedKey
36: * <em>Key</em>}</li>
37: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.EClassToAMapImpl#getTypedValue
38: * <em>Value</em>}</li>
39: * </ul>
40: *
41: * @generated
42: */
43: public class EClassToAMapImpl extends MinimalEObjectImpl.Container implements BasicEMap.Entry<EClass, A> {
44:         /**
45:          * The cached value of the '{@link #getTypedKey() <em>Key</em>}' reference.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @see #getTypedKey()
50:          * @generated
51:          * @ordered
52:          */
53:         protected EClass key;
54:
55:         /**
56:          * The cached value of the '{@link #getTypedValue() <em>Value</em>}' reference.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @see #getTypedValue()
61:          * @generated
62:          * @ordered
63:          */
64:         protected A value;
65:
66:         /**
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         protected EClassToAMapImpl() {
73:                 super();
74:         }
75:
76:         /**
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         @Override
83:         protected EClass eStaticClass() {
84:                 return TestPackage.Literals.ECLASS_TO_AMAP;
85:         }
86:
87:         /**
88:          * <!-- begin-user-doc -->
89:          * <!-- end-user-doc -->
90:          *
91:          * @generated
92:          */
93:         public EClass getTypedKey() {
94:•                if (key != null && key.eIsProxy()) {
95:                         final InternalEObject oldKey = (InternalEObject) key;
96:                         key = (EClass) eResolveProxy(oldKey);
97:•                        if (key != oldKey) {
98:•                                if (eNotificationRequired()) {
99:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestPackage.ECLASS_TO_AMAP__KEY, oldKey,
100:                                                 key));
101:                                 }
102:                         }
103:                 }
104:                 return key;
105:         }
106:
107:         /**
108:          * <!-- begin-user-doc -->
109:          * <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         public EClass basicGetTypedKey() {
114:                 return key;
115:         }
116:
117:         /**
118:          * <!-- begin-user-doc -->
119:          * <!-- end-user-doc -->
120:          *
121:          * @generated
122:          */
123:         public void setTypedKey(EClass newKey) {
124:                 final EClass oldKey = key;
125:                 key = newKey;
126:•                if (eNotificationRequired()) {
127:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.ECLASS_TO_AMAP__KEY, oldKey, key));
128:                 }
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         public A getTypedValue() {
138:•                if (value != null && value.eIsProxy()) {
139:                         final InternalEObject oldValue = (InternalEObject) value;
140:                         value = (A) eResolveProxy(oldValue);
141:•                        if (value != oldValue) {
142:•                                if (eNotificationRequired()) {
143:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestPackage.ECLASS_TO_AMAP__VALUE,
144:                                                 oldValue, value));
145:                                 }
146:                         }
147:                 }
148:                 return value;
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         public A basicGetTypedValue() {
158:                 return value;
159:         }
160:
161:         /**
162:          * <!-- begin-user-doc -->
163:          * <!-- end-user-doc -->
164:          *
165:          * @generated
166:          */
167:         public void setTypedValue(A newValue) {
168:                 final A oldValue = value;
169:                 value = newValue;
170:•                if (eNotificationRequired()) {
171:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.ECLASS_TO_AMAP__VALUE, oldValue, value));
172:                 }
173:         }
174:
175:         /**
176:          * <!-- begin-user-doc -->
177:          * <!-- end-user-doc -->
178:          *
179:          * @generated
180:          */
181:         @Override
182:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
183:•                switch (featureID) {
184:                 case TestPackage.ECLASS_TO_AMAP__KEY:
185:•                        if (resolve) {
186:                                 return getTypedKey();
187:                         }
188:                         return basicGetTypedKey();
189:                 case TestPackage.ECLASS_TO_AMAP__VALUE:
190:•                        if (resolve) {
191:                                 return getTypedValue();
192:                         }
193:                         return basicGetTypedValue();
194:                 }
195:                 return super.eGet(featureID, resolve, coreType);
196:         }
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          * <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         @Override
205:         public void eSet(int featureID, Object newValue) {
206:•                switch (featureID) {
207:                 case TestPackage.ECLASS_TO_AMAP__KEY:
208:                         setTypedKey((EClass) newValue);
209:                         return;
210:                 case TestPackage.ECLASS_TO_AMAP__VALUE:
211:                         setTypedValue((A) newValue);
212:                         return;
213:                 }
214:                 super.eSet(featureID, newValue);
215:         }
216:
217:         /**
218:          * <!-- begin-user-doc -->
219:          * <!-- end-user-doc -->
220:          *
221:          * @generated
222:          */
223:         @Override
224:         public void eUnset(int featureID) {
225:•                switch (featureID) {
226:                 case TestPackage.ECLASS_TO_AMAP__KEY:
227:                         setTypedKey((EClass) null);
228:                         return;
229:                 case TestPackage.ECLASS_TO_AMAP__VALUE:
230:                         setTypedValue((A) null);
231:                         return;
232:                 }
233:                 super.eUnset(featureID);
234:         }
235:
236:         /**
237:          * <!-- begin-user-doc -->
238:          * <!-- end-user-doc -->
239:          *
240:          * @generated
241:          */
242:         @Override
243:         public boolean eIsSet(int featureID) {
244:•                switch (featureID) {
245:                 case TestPackage.ECLASS_TO_AMAP__KEY:
246:•                        return key != null;
247:                 case TestPackage.ECLASS_TO_AMAP__VALUE:
248:•                        return value != null;
249:                 }
250:                 return super.eIsSet(featureID);
251:         }
252:
253:         /**
254:          * <!-- begin-user-doc -->
255:          * <!-- end-user-doc -->
256:          *
257:          * @generated
258:          */
259:         protected int hash = -1;
260:
261:         /**
262:          * <!-- begin-user-doc -->
263:          * <!-- end-user-doc -->
264:          *
265:          * @generated
266:          */
267:         @Override
268:         public int getHash() {
269:•                if (hash == -1) {
270:                         final Object theKey = getKey();
271:•                        hash = theKey == null ? 0 : theKey.hashCode();
272:                 }
273:                 return hash;
274:         }
275:
276:         /**
277:          * <!-- begin-user-doc -->
278:          * <!-- end-user-doc -->
279:          *
280:          * @generated
281:          */
282:         @Override
283:         public void setHash(int hash) {
284:                 this.hash = hash;
285:         }
286:
287:         /**
288:          * <!-- begin-user-doc -->
289:          * <!-- end-user-doc -->
290:          *
291:          * @generated
292:          */
293:         @Override
294:         public EClass getKey() {
295:                 return getTypedKey();
296:         }
297:
298:         /**
299:          * <!-- begin-user-doc -->
300:          * <!-- end-user-doc -->
301:          *
302:          * @generated
303:          */
304:         @Override
305:         public void setKey(EClass key) {
306:                 setTypedKey(key);
307:         }
308:
309:         /**
310:          * <!-- begin-user-doc -->
311:          * <!-- end-user-doc -->
312:          *
313:          * @generated
314:          */
315:         @Override
316:         public A getValue() {
317:                 return getTypedValue();
318:         }
319:
320:         /**
321:          * <!-- begin-user-doc -->
322:          * <!-- end-user-doc -->
323:          *
324:          * @generated
325:          */
326:         @Override
327:         public A setValue(A value) {
328:                 final A oldValue = getValue();
329:                 setTypedValue(value);
330:                 return oldValue;
331:         }
332:
333:         /**
334:          * <!-- begin-user-doc -->
335:          * <!-- end-user-doc -->
336:          *
337:          * @generated
338:          */
339:         @SuppressWarnings("unchecked")
340:         public EMap<EClass, A> getEMap() {
341:                 final EObject container = eContainer();
342:•                return container == null ? null : (EMap<EClass, A>) container.eGet(eContainmentFeature());
343:         }
344:
345: } // EClassToAMapImpl