Skip to content

Package: TestDataImpl

TestDataImpl

nameinstructionbranchcomplexitylinemethod
TestDataImpl()
M: 0 C: 24
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 9
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 6 C: 28
82%
M: 1 C: 7
88%
M: 1 C: 7
88%
M: 1 C: 8
89%
M: 0 C: 1
100%
eIsSet(int)
M: 79 C: 0
0%
M: 28 C: 0
0%
M: 18 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 10 C: 37
79%
M: 2 C: 6
75%
M: 2 C: 6
75%
M: 4 C: 13
76%
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: 34 C: 0
0%
M: 8 C: 0
0%
M: 8 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%
getDouble()
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%
getFloat()
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%
getInteger()
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%
getLong()
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%
getString()
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%
getStringMax8()
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%
isBoolean()
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%
setBoolean(boolean)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 6
100%
M: 0 C: 1
100%
setDouble(double)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 6
100%
M: 0 C: 1
100%
setFloat(float)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 5
100%
M: 0 C: 1
100%
setInteger(int)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 6
100%
M: 0 C: 1
100%
setLong(long)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 5
100%
M: 0 C: 1
100%
setString(String)
M: 0 C: 21
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 6
100%
M: 0 C: 1
100%
setStringMax8(String)
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%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 82 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 19 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2018 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: * EclipseSource Muenchen GmbH - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.edit.internal.model.testData.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
20: import org.eclipse.emf.ecp.edit.internal.model.testData.TestData;
21: import org.eclipse.emf.ecp.edit.internal.model.testData.TestDataPackage;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * An implementation of the model object '<em><b>Test Data</b></em>'.
26: * <!-- end-user-doc -->
27: * <p>
28: * The following features are implemented:
29: * </p>
30: * <ul>
31: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getString <em>String</em>}</li>
32: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#isBoolean <em>Boolean</em>}</li>
33: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getInteger <em>Integer</em>}</li>
34: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getLong <em>Long</em>}</li>
35: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getFloat <em>Float</em>}</li>
36: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getDouble <em>Double</em>}</li>
37: * <li>{@link org.eclipse.emf.ecp.edit.internal.model.testData.impl.TestDataImpl#getStringMax8 <em>String
38: * Max8</em>}</li>
39: * </ul>
40: *
41: * @generated
42: */
43: public class TestDataImpl extends MinimalEObjectImpl.Container implements TestData {
44:         /**
45:          * The default value of the '{@link #getString() <em>String</em>}' attribute.
46:          * <!-- begin-user-doc -->
47:          * <!-- end-user-doc -->
48:          *
49:          * @see #getString()
50:          * @generated
51:          * @ordered
52:          */
53:         protected static final String STRING_EDEFAULT = null;
54:
55:         /**
56:          * The cached value of the '{@link #getString() <em>String</em>}' attribute.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @see #getString()
61:          * @generated
62:          * @ordered
63:          */
64:         protected String string = STRING_EDEFAULT;
65:
66:         /**
67:          * The default value of the '{@link #isBoolean() <em>Boolean</em>}' attribute.
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @see #isBoolean()
72:          * @generated
73:          * @ordered
74:          */
75:         protected static final boolean BOOLEAN_EDEFAULT = false;
76:
77:         /**
78:          * The cached value of the '{@link #isBoolean() <em>Boolean</em>}' attribute.
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @see #isBoolean()
83:          * @generated
84:          * @ordered
85:          */
86:         protected boolean boolean_ = BOOLEAN_EDEFAULT;
87:
88:         /**
89:          * The default value of the '{@link #getInteger() <em>Integer</em>}' attribute.
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @see #getInteger()
94:          * @generated
95:          * @ordered
96:          */
97:         protected static final int INTEGER_EDEFAULT = 0;
98:
99:         /**
100:          * The cached value of the '{@link #getInteger() <em>Integer</em>}' attribute.
101:          * <!-- begin-user-doc -->
102:          * <!-- end-user-doc -->
103:          *
104:          * @see #getInteger()
105:          * @generated
106:          * @ordered
107:          */
108:         protected int integer = INTEGER_EDEFAULT;
109:
110:         /**
111:          * The default value of the '{@link #getLong() <em>Long</em>}' attribute.
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @see #getLong()
116:          * @generated
117:          * @ordered
118:          */
119:         protected static final long LONG_EDEFAULT = 0L;
120:
121:         /**
122:          * The cached value of the '{@link #getLong() <em>Long</em>}' attribute.
123:          * <!-- begin-user-doc -->
124:          * <!-- end-user-doc -->
125:          *
126:          * @see #getLong()
127:          * @generated
128:          * @ordered
129:          */
130:         protected long long_ = LONG_EDEFAULT;
131:
132:         /**
133:          * The default value of the '{@link #getFloat() <em>Float</em>}' attribute.
134:          * <!-- begin-user-doc -->
135:          * <!-- end-user-doc -->
136:          *
137:          * @see #getFloat()
138:          * @generated
139:          * @ordered
140:          */
141:         protected static final float FLOAT_EDEFAULT = 0.0F;
142:
143:         /**
144:          * The cached value of the '{@link #getFloat() <em>Float</em>}' attribute.
145:          * <!-- begin-user-doc -->
146:          * <!-- end-user-doc -->
147:          *
148:          * @see #getFloat()
149:          * @generated
150:          * @ordered
151:          */
152:         protected float float_ = FLOAT_EDEFAULT;
153:
154:         /**
155:          * The default value of the '{@link #getDouble() <em>Double</em>}' attribute.
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @see #getDouble()
160:          * @generated
161:          * @ordered
162:          */
163:         protected static final double DOUBLE_EDEFAULT = 0.0;
164:
165:         /**
166:          * The cached value of the '{@link #getDouble() <em>Double</em>}' attribute.
167:          * <!-- begin-user-doc -->
168:          * <!-- end-user-doc -->
169:          *
170:          * @see #getDouble()
171:          * @generated
172:          * @ordered
173:          */
174:         protected double double_ = DOUBLE_EDEFAULT;
175:
176:         /**
177:          * The default value of the '{@link #getStringMax8() <em>String Max8</em>}' attribute.
178:          * <!-- begin-user-doc -->
179:          * <!-- end-user-doc -->
180:          *
181:          * @see #getStringMax8()
182:          * @generated
183:          * @ordered
184:          */
185:         protected static final String STRING_MAX8_EDEFAULT = null;
186:
187:         /**
188:          * The cached value of the '{@link #getStringMax8() <em>String Max8</em>}' attribute.
189:          * <!-- begin-user-doc -->
190:          * <!-- end-user-doc -->
191:          *
192:          * @see #getStringMax8()
193:          * @generated
194:          * @ordered
195:          */
196:         protected String stringMax8 = STRING_MAX8_EDEFAULT;
197:
198:         /**
199:          * <!-- begin-user-doc -->
200:          * <!-- end-user-doc -->
201:          *
202:          * @generated
203:          */
204:         protected TestDataImpl() {
205:                 super();
206:         }
207:
208:         /**
209:          * <!-- begin-user-doc -->
210:          * <!-- end-user-doc -->
211:          *
212:          * @generated
213:          */
214:         @Override
215:         protected EClass eStaticClass() {
216:                 return TestDataPackage.Literals.TEST_DATA;
217:         }
218:
219:         /**
220:          * <!-- begin-user-doc -->
221:          * <!-- end-user-doc -->
222:          *
223:          * @generated
224:          */
225:         public String getString() {
226:                 return string;
227:         }
228:
229:         /**
230:          * <!-- begin-user-doc -->
231:          * <!-- end-user-doc -->
232:          *
233:          * @generated
234:          */
235:         public void setString(String newString) {
236:                 final String oldString = string;
237:                 string = newString;
238:•                if (eNotificationRequired()) {
239:                         eNotify(
240:                                 new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__STRING, oldString, string));
241:                 }
242:         }
243:
244:         /**
245:          * <!-- begin-user-doc -->
246:          * <!-- end-user-doc -->
247:          *
248:          * @generated
249:          */
250:         public boolean isBoolean() {
251:                 return boolean_;
252:         }
253:
254:         /**
255:          * <!-- begin-user-doc -->
256:          * <!-- end-user-doc -->
257:          *
258:          * @generated
259:          */
260:         public void setBoolean(boolean newBoolean) {
261:                 final boolean oldBoolean = boolean_;
262:                 boolean_ = newBoolean;
263:•                if (eNotificationRequired()) {
264:                         eNotify(new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__BOOLEAN, oldBoolean,
265:                                 boolean_));
266:                 }
267:         }
268:
269:         /**
270:          * <!-- begin-user-doc -->
271:          * <!-- end-user-doc -->
272:          *
273:          * @generated
274:          */
275:         public int getInteger() {
276:                 return integer;
277:         }
278:
279:         /**
280:          * <!-- begin-user-doc -->
281:          * <!-- end-user-doc -->
282:          *
283:          * @generated
284:          */
285:         public void setInteger(int newInteger) {
286:                 final int oldInteger = integer;
287:                 integer = newInteger;
288:•                if (eNotificationRequired()) {
289:                         eNotify(
290:                                 new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__INTEGER, oldInteger, integer));
291:                 }
292:         }
293:
294:         /**
295:          * <!-- begin-user-doc -->
296:          * <!-- end-user-doc -->
297:          *
298:          * @generated
299:          */
300:         public long getLong() {
301:                 return long_;
302:         }
303:
304:         /**
305:          * <!-- begin-user-doc -->
306:          * <!-- end-user-doc -->
307:          *
308:          * @generated
309:          */
310:         public void setLong(long newLong) {
311:                 final long oldLong = long_;
312:                 long_ = newLong;
313:•                if (eNotificationRequired()) {
314:                         eNotify(new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__LONG, oldLong, long_));
315:                 }
316:         }
317:
318:         /**
319:          * <!-- begin-user-doc -->
320:          * <!-- end-user-doc -->
321:          *
322:          * @generated
323:          */
324:         public float getFloat() {
325:                 return float_;
326:         }
327:
328:         /**
329:          * <!-- begin-user-doc -->
330:          * <!-- end-user-doc -->
331:          *
332:          * @generated
333:          */
334:         public void setFloat(float newFloat) {
335:                 final float oldFloat = float_;
336:                 float_ = newFloat;
337:•                if (eNotificationRequired()) {
338:                         eNotify(new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__FLOAT, oldFloat, float_));
339:                 }
340:         }
341:
342:         /**
343:          * <!-- begin-user-doc -->
344:          * <!-- end-user-doc -->
345:          *
346:          * @generated
347:          */
348:         public double getDouble() {
349:                 return double_;
350:         }
351:
352:         /**
353:          * <!-- begin-user-doc -->
354:          * <!-- end-user-doc -->
355:          *
356:          * @generated
357:          */
358:         public void setDouble(double newDouble) {
359:                 final double oldDouble = double_;
360:                 double_ = newDouble;
361:•                if (eNotificationRequired()) {
362:                         eNotify(
363:                                 new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__DOUBLE, oldDouble, double_));
364:                 }
365:         }
366:
367:         /**
368:          * <!-- begin-user-doc -->
369:          * <!-- end-user-doc -->
370:          *
371:          * @generated
372:          */
373:         public String getStringMax8() {
374:                 return stringMax8;
375:         }
376:
377:         /**
378:          * <!-- begin-user-doc -->
379:          * <!-- end-user-doc -->
380:          *
381:          * @generated
382:          */
383:         public void setStringMax8(String newStringMax8) {
384:                 final String oldStringMax8 = stringMax8;
385:                 stringMax8 = newStringMax8;
386:•                if (eNotificationRequired()) {
387:                         eNotify(new ENotificationImpl(this, Notification.SET, TestDataPackage.TEST_DATA__STRING_MAX8, oldStringMax8,
388:                                 stringMax8));
389:                 }
390:         }
391:
392:         /**
393:          * <!-- begin-user-doc -->
394:          * <!-- end-user-doc -->
395:          *
396:          * @generated
397:          */
398:         @Override
399:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
400:•                switch (featureID) {
401:                 case TestDataPackage.TEST_DATA__STRING:
402:                         return getString();
403:                 case TestDataPackage.TEST_DATA__BOOLEAN:
404:                         return isBoolean();
405:                 case TestDataPackage.TEST_DATA__INTEGER:
406:                         return getInteger();
407:                 case TestDataPackage.TEST_DATA__LONG:
408:                         return getLong();
409:                 case TestDataPackage.TEST_DATA__FLOAT:
410:                         return getFloat();
411:                 case TestDataPackage.TEST_DATA__DOUBLE:
412:                         return getDouble();
413:                 case TestDataPackage.TEST_DATA__STRING_MAX8:
414:                         return getStringMax8();
415:                 }
416:                 return super.eGet(featureID, resolve, coreType);
417:         }
418:
419:         /**
420:          * <!-- begin-user-doc -->
421:          * <!-- end-user-doc -->
422:          *
423:          * @generated
424:          */
425:         @Override
426:         public void eSet(int featureID, Object newValue) {
427:•                switch (featureID) {
428:                 case TestDataPackage.TEST_DATA__STRING:
429:                         setString((String) newValue);
430:                         return;
431:                 case TestDataPackage.TEST_DATA__BOOLEAN:
432:                         setBoolean((Boolean) newValue);
433:                         return;
434:                 case TestDataPackage.TEST_DATA__INTEGER:
435:                         setInteger((Integer) newValue);
436:                         return;
437:                 case TestDataPackage.TEST_DATA__LONG:
438:                         setLong((Long) newValue);
439:                         return;
440:                 case TestDataPackage.TEST_DATA__FLOAT:
441:                         setFloat((Float) newValue);
442:                         return;
443:                 case TestDataPackage.TEST_DATA__DOUBLE:
444:                         setDouble((Double) newValue);
445:                         return;
446:                 case TestDataPackage.TEST_DATA__STRING_MAX8:
447:                         setStringMax8((String) newValue);
448:                         return;
449:                 }
450:                 super.eSet(featureID, newValue);
451:         }
452:
453:         /**
454:          * <!-- begin-user-doc -->
455:          * <!-- end-user-doc -->
456:          *
457:          * @generated
458:          */
459:         @Override
460:         public void eUnset(int featureID) {
461:•                switch (featureID) {
462:                 case TestDataPackage.TEST_DATA__STRING:
463:                         setString(STRING_EDEFAULT);
464:                         return;
465:                 case TestDataPackage.TEST_DATA__BOOLEAN:
466:                         setBoolean(BOOLEAN_EDEFAULT);
467:                         return;
468:                 case TestDataPackage.TEST_DATA__INTEGER:
469:                         setInteger(INTEGER_EDEFAULT);
470:                         return;
471:                 case TestDataPackage.TEST_DATA__LONG:
472:                         setLong(LONG_EDEFAULT);
473:                         return;
474:                 case TestDataPackage.TEST_DATA__FLOAT:
475:                         setFloat(FLOAT_EDEFAULT);
476:                         return;
477:                 case TestDataPackage.TEST_DATA__DOUBLE:
478:                         setDouble(DOUBLE_EDEFAULT);
479:                         return;
480:                 case TestDataPackage.TEST_DATA__STRING_MAX8:
481:                         setStringMax8(STRING_MAX8_EDEFAULT);
482:                         return;
483:                 }
484:                 super.eUnset(featureID);
485:         }
486:
487:         /**
488:          * <!-- begin-user-doc -->
489:          * <!-- end-user-doc -->
490:          *
491:          * @generated
492:          */
493:         @Override
494:         public boolean eIsSet(int featureID) {
495:•                switch (featureID) {
496:                 case TestDataPackage.TEST_DATA__STRING:
497:•                        return STRING_EDEFAULT == null ? string != null : !STRING_EDEFAULT.equals(string);
498:                 case TestDataPackage.TEST_DATA__BOOLEAN:
499:                         return boolean_ != BOOLEAN_EDEFAULT;
500:                 case TestDataPackage.TEST_DATA__INTEGER:
501:•                        return integer != INTEGER_EDEFAULT;
502:                 case TestDataPackage.TEST_DATA__LONG:
503:•                        return long_ != LONG_EDEFAULT;
504:                 case TestDataPackage.TEST_DATA__FLOAT:
505:•                        return float_ != FLOAT_EDEFAULT;
506:                 case TestDataPackage.TEST_DATA__DOUBLE:
507:•                        return double_ != DOUBLE_EDEFAULT;
508:                 case TestDataPackage.TEST_DATA__STRING_MAX8:
509:•                        return STRING_MAX8_EDEFAULT == null ? stringMax8 != null : !STRING_MAX8_EDEFAULT.equals(stringMax8);
510:                 }
511:                 return super.eIsSet(featureID);
512:         }
513:
514:         /**
515:          * <!-- begin-user-doc -->
516:          * <!-- end-user-doc -->
517:          *
518:          * @generated
519:          */
520:         @Override
521:         public String toString() {
522:•                if (eIsProxy()) {
523:                         return super.toString();
524:                 }
525:
526:                 final StringBuffer result = new StringBuffer(super.toString());
527:                 result.append(" (string: "); //$NON-NLS-1$
528:                 result.append(string);
529:                 result.append(", boolean: "); //$NON-NLS-1$
530:                 result.append(boolean_);
531:                 result.append(", integer: "); //$NON-NLS-1$
532:                 result.append(integer);
533:                 result.append(", long: "); //$NON-NLS-1$
534:                 result.append(long_);
535:                 result.append(", float: "); //$NON-NLS-1$
536:                 result.append(float_);
537:                 result.append(", double: "); //$NON-NLS-1$
538:                 result.append(double_);
539:                 result.append(", stringMax8: "); //$NON-NLS-1$
540:                 result.append(stringMax8);
541:                 result.append(')');
542:                 return result.toString();
543:         }
544:
545: } // TestDataImpl