Skip to content

Package: EClassToEStringMapImpl

EClassToEStringMapImpl

nameinstructionbranchcomplexitylinemethod
EClassToEStringMapImpl()
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
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%
eGet(int, boolean, boolean)
M: 19 C: 0
0%
M: 5 C: 0
0%
M: 4 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 31 C: 0
0%
M: 11 C: 0
0%
M: 7 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: 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: 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: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
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(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setValue(String)
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%
static {...}
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%
toString()
M: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%

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