Skip to content

Package: EClassToAdditionMapImpl

EClassToAdditionMapImpl

nameinstructionbranchcomplexitylinemethod
EClassToAdditionMapImpl()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
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: 24 C: 0
0%
M: 7 C: 0
0%
M: 5 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 20 C: 0
0%
M: 7 C: 0
0%
M: 5 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
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: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
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: 18 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getKey()
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%
getTypedKey()
M: 38 C: 0
0%
M: 8 C: 0
0%
M: 5 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
getTypedValue()
M: 38 C: 0
0%
M: 8 C: 0
0%
M: 5 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
getValue()
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%
setHash(int)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setKey(EClass)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setTypedKey(EClass)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
setTypedValue(AbstractChild)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
setValue(AbstractChild)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2014 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.mapping.test.example.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.emf.ecp.view.mapping.test.example.AbstractChild;
25: import org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>EClass To Addition Map</b></em>'.
30: * <!-- end-user-doc -->
31: * <p>
32: * The following features are implemented:
33: * <ul>
34: * <li>{@link org.eclipse.emf.ecp.view.mapping.test.example.impl.EClassToAdditionMapImpl#getTypedKey <em>Key</em>}</li>
35: * <li>{@link org.eclipse.emf.ecp.view.mapping.test.example.impl.EClassToAdditionMapImpl#getTypedValue
36: * <em>Value</em>}</li>
37: * </ul>
38: * </p>
39: *
40: * @generated
41: */
42: public class EClassToAdditionMapImpl extends MinimalEObjectImpl.Container implements
43:         BasicEMap.Entry<EClass, AbstractChild> {
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 AbstractChild value;
65:
66:         /**
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @generated
71:          */
72:         protected EClassToAdditionMapImpl() {
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 ExamplePackage.Literals.ECLASS_TO_ADDITION_MAP;
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,
100:                                                 ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY, oldKey, 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, ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY, oldKey,
128:                                 key));
129:                 }
130:         }
131:
132:         /**
133:          * <!-- begin-user-doc -->
134:          * <!-- end-user-doc -->
135:          *
136:          * @generated
137:          */
138:         public AbstractChild getTypedValue() {
139:•                if (value != null && value.eIsProxy()) {
140:                         final InternalEObject oldValue = (InternalEObject) value;
141:                         value = (AbstractChild) eResolveProxy(oldValue);
142:•                        if (value != oldValue) {
143:•                                if (eNotificationRequired()) {
144:                                         eNotify(new ENotificationImpl(this, Notification.RESOLVE,
145:                                                 ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE, oldValue, value));
146:                                 }
147:                         }
148:                 }
149:                 return value;
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @generated
157:          */
158:         public AbstractChild basicGetTypedValue() {
159:                 return value;
160:         }
161:
162:         /**
163:          * <!-- begin-user-doc -->
164:          * <!-- end-user-doc -->
165:          *
166:          * @generated
167:          */
168:         public void setTypedValue(AbstractChild newValue) {
169:                 final AbstractChild oldValue = value;
170:                 value = newValue;
171:•                if (eNotificationRequired()) {
172:                         eNotify(new ENotificationImpl(this, Notification.SET, ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE,
173:                                 oldValue, value));
174:                 }
175:         }
176:
177:         /**
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @generated
182:          */
183:         @Override
184:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
185:•                switch (featureID) {
186:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY:
187:•                        if (resolve) {
188:                                 return getTypedKey();
189:                         }
190:                         return basicGetTypedKey();
191:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE:
192:•                        if (resolve) {
193:                                 return getTypedValue();
194:                         }
195:                         return basicGetTypedValue();
196:                 }
197:                 return super.eGet(featureID, resolve, coreType);
198:         }
199:
200:         /**
201:          * <!-- begin-user-doc -->
202:          * <!-- end-user-doc -->
203:          *
204:          * @generated
205:          */
206:         @Override
207:         public void eSet(int featureID, Object newValue) {
208:•                switch (featureID) {
209:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY:
210:                         setTypedKey((EClass) newValue);
211:                         return;
212:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE:
213:                         setTypedValue((AbstractChild) newValue);
214:                         return;
215:                 }
216:                 super.eSet(featureID, newValue);
217:         }
218:
219:         /**
220:          * <!-- begin-user-doc -->
221:          * <!-- end-user-doc -->
222:          *
223:          * @generated
224:          */
225:         @Override
226:         public void eUnset(int featureID) {
227:•                switch (featureID) {
228:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY:
229:                         setTypedKey((EClass) null);
230:                         return;
231:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE:
232:                         setTypedValue((AbstractChild) null);
233:                         return;
234:                 }
235:                 super.eUnset(featureID);
236:         }
237:
238:         /**
239:          * <!-- begin-user-doc -->
240:          * <!-- end-user-doc -->
241:          *
242:          * @generated
243:          */
244:         @Override
245:         public boolean eIsSet(int featureID) {
246:•                switch (featureID) {
247:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__KEY:
248:•                        return key != null;
249:                 case ExamplePackage.ECLASS_TO_ADDITION_MAP__VALUE:
250:•                        return value != null;
251:                 }
252:                 return super.eIsSet(featureID);
253:         }
254:
255:         /**
256:          * <!-- begin-user-doc -->
257:          * <!-- end-user-doc -->
258:          *
259:          * @generated
260:          */
261:         protected int hash = -1;
262:
263:         /**
264:          * <!-- begin-user-doc -->
265:          * <!-- end-user-doc -->
266:          *
267:          * @generated
268:          */
269:         @Override
270:         public int getHash() {
271:•                if (hash == -1) {
272:                         final Object theKey = getKey();
273:•                        hash = theKey == null ? 0 : theKey.hashCode();
274:                 }
275:                 return hash;
276:         }
277:
278:         /**
279:          * <!-- begin-user-doc -->
280:          * <!-- end-user-doc -->
281:          *
282:          * @generated
283:          */
284:         @Override
285:         public void setHash(int hash) {
286:                 this.hash = hash;
287:         }
288:
289:         /**
290:          * <!-- begin-user-doc -->
291:          * <!-- end-user-doc -->
292:          *
293:          * @generated
294:          */
295:         @Override
296:         public EClass getKey() {
297:                 return getTypedKey();
298:         }
299:
300:         /**
301:          * <!-- begin-user-doc -->
302:          * <!-- end-user-doc -->
303:          *
304:          * @generated
305:          */
306:         @Override
307:         public void setKey(EClass key) {
308:                 setTypedKey(key);
309:         }
310:
311:         /**
312:          * <!-- begin-user-doc -->
313:          * <!-- end-user-doc -->
314:          *
315:          * @generated
316:          */
317:         @Override
318:         public AbstractChild getValue() {
319:                 return getTypedValue();
320:         }
321:
322:         /**
323:          * <!-- begin-user-doc -->
324:          * <!-- end-user-doc -->
325:          *
326:          * @generated
327:          */
328:         @Override
329:         public AbstractChild setValue(AbstractChild value) {
330:                 final AbstractChild oldValue = getValue();
331:                 setTypedValue(value);
332:                 return oldValue;
333:         }
334:
335:         /**
336:          * <!-- begin-user-doc -->
337:          * <!-- end-user-doc -->
338:          *
339:          * @generated
340:          */
341:         @SuppressWarnings("unchecked")
342:         public EMap<EClass, AbstractChild> getEMap() {
343:                 final EObject container = eContainer();
344:•                return container == null ? null : (EMap<EClass, AbstractChild>) container.eGet(eContainmentFeature());
345:         }
346:
347: } // EClassToAdditionMapImpl