Skip to content

Package: ChildLevel1Impl

ChildLevel1Impl

nameinstructionbranchcomplexitylinemethod
ChildLevel1Impl()
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%
eGet(int, boolean, boolean)
M: 6 C: 8
57%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 1 C: 3
75%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 12 C: 23
66%
M: 5 C: 8
62%
M: 4 C: 4
50%
M: 3 C: 3
50%
M: 0 C: 1
100%
eSet(int, Object)
M: 22 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 8 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%
getChildren()
M: 0 C: 14
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getName()
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%
setName(String)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 6
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-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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.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.impl.MinimalEObjectImpl;
25: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
26: import org.eclipse.emf.ecore.util.InternalEList;
27: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel1;
28: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2;
29: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage;
30:
31: /**
32: * <!-- begin-user-doc --> An implementation of the model object ' <em><b>Child Level1</b></em>'. <!-- end-user-doc -->
33: * <p>
34: * The following features are implemented:
35: * <ul>
36: * <li>
37: * {@link org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.impl.ChildLevel1Impl#getName
38: * <em>Name</em>}</li>
39: * <li>
40: * {@link org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.impl.ChildLevel1Impl#getChildren
41: * <em>Children</em>}</li>
42: * </ul>
43: * </p>
44: *
45: * @generated
46: */
47: public class ChildLevel1Impl extends MinimalEObjectImpl.Container implements
48:         ChildLevel1 {
49:         /**
50:          * The default value of the '{@link #getName() <em>Name</em>}' attribute.
51:          * <!-- begin-user-doc --> <!-- end-user-doc -->
52:          *
53:          * @see #getName()
54:          * @generated
55:          * @ordered
56:          */
57:         protected static final String NAME_EDEFAULT = null;
58:
59:         /**
60:          * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
61:          * <!-- begin-user-doc --> <!-- end-user-doc -->
62:          *
63:          * @see #getName()
64:          * @generated
65:          * @ordered
66:          */
67:         protected String name = NAME_EDEFAULT;
68:
69:         /**
70:          * The cached value of the '{@link #getChildren() <em>Children</em>}'
71:          * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc -->
72:          *
73:          * @see #getChildren()
74:          * @generated
75:          * @ordered
76:          */
77:         protected EList<ChildLevel2> children;
78:
79:         /**
80:          * <!-- begin-user-doc --> <!-- end-user-doc -->
81:          *
82:          * @generated
83:          */
84:         protected ChildLevel1Impl() {
85:                 super();
86:         }
87:
88:         /**
89:          * <!-- begin-user-doc --> <!-- end-user-doc -->
90:          *
91:          * @generated
92:          */
93:         @Override
94:         protected EClass eStaticClass() {
95:                 return TestTMDPackage.Literals.CHILD_LEVEL1;
96:         }
97:
98:         /**
99:          * <!-- begin-user-doc --> <!-- end-user-doc -->
100:          *
101:          * @generated
102:          */
103:         @Override
104:         public String getName() {
105:                 return name;
106:         }
107:
108:         /**
109:          * <!-- begin-user-doc --> <!-- end-user-doc -->
110:          *
111:          * @generated
112:          */
113:         @Override
114:         public void setName(String newName) {
115:                 final String oldName = name;
116:                 name = newName;
117:•                if (eNotificationRequired()) {
118:                         eNotify(new ENotificationImpl(this, Notification.SET,
119:                                 TestTMDPackage.CHILD_LEVEL1__NAME, oldName, name));
120:                 }
121:         }
122:
123:         /**
124:          * <!-- begin-user-doc --> <!-- end-user-doc -->
125:          *
126:          * @generated
127:          */
128:         @Override
129:         public EList<ChildLevel2> getChildren() {
130:•                if (children == null) {
131:                         children = new EObjectContainmentEList<ChildLevel2>(
132:                                 ChildLevel2.class, this,
133:                                 TestTMDPackage.CHILD_LEVEL1__CHILDREN);
134:                 }
135:                 return children;
136:         }
137:
138:         /**
139:          * <!-- begin-user-doc --> <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public NotificationChain eInverseRemove(InternalEObject otherEnd,
145:                 int featureID, NotificationChain msgs) {
146:•                switch (featureID) {
147:                 case TestTMDPackage.CHILD_LEVEL1__CHILDREN:
148:                         return ((InternalEList<?>) getChildren()).basicRemove(otherEnd,
149:                                 msgs);
150:                 }
151:                 return super.eInverseRemove(otherEnd, featureID, msgs);
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc --> <!-- end-user-doc -->
156:          *
157:          * @generated
158:          */
159:         @Override
160:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
161:•                switch (featureID) {
162:                 case TestTMDPackage.CHILD_LEVEL1__NAME:
163:                         return getName();
164:                 case TestTMDPackage.CHILD_LEVEL1__CHILDREN:
165:                         return getChildren();
166:                 }
167:                 return super.eGet(featureID, resolve, coreType);
168:         }
169:
170:         /**
171:          * <!-- begin-user-doc --> <!-- end-user-doc -->
172:          *
173:          * @generated
174:          */
175:         @SuppressWarnings("unchecked")
176:         @Override
177:         public void eSet(int featureID, Object newValue) {
178:•                switch (featureID) {
179:                 case TestTMDPackage.CHILD_LEVEL1__NAME:
180:                         setName((String) newValue);
181:                         return;
182:                 case TestTMDPackage.CHILD_LEVEL1__CHILDREN:
183:                         getChildren().clear();
184:                         getChildren().addAll((Collection<? extends ChildLevel2>) newValue);
185:                         return;
186:                 }
187:                 super.eSet(featureID, newValue);
188:         }
189:
190:         /**
191:          * <!-- begin-user-doc --> <!-- end-user-doc -->
192:          *
193:          * @generated
194:          */
195:         @Override
196:         public void eUnset(int featureID) {
197:•                switch (featureID) {
198:                 case TestTMDPackage.CHILD_LEVEL1__NAME:
199:                         setName(NAME_EDEFAULT);
200:                         return;
201:                 case TestTMDPackage.CHILD_LEVEL1__CHILDREN:
202:                         getChildren().clear();
203:                         return;
204:                 }
205:                 super.eUnset(featureID);
206:         }
207:
208:         /**
209:          * <!-- begin-user-doc --> <!-- end-user-doc -->
210:          *
211:          * @generated
212:          */
213:         @Override
214:         public boolean eIsSet(int featureID) {
215:•                switch (featureID) {
216:                 case TestTMDPackage.CHILD_LEVEL1__NAME:
217:•                        return NAME_EDEFAULT == null ? name != null
218:                                 : !NAME_EDEFAULT
219:•                                        .equals(name);
220:                 case TestTMDPackage.CHILD_LEVEL1__CHILDREN:
221:•                        return children != null && !children.isEmpty();
222:                 }
223:                 return super.eIsSet(featureID);
224:         }
225:
226:         /**
227:          * <!-- begin-user-doc --> <!-- end-user-doc -->
228:          *
229:          * @generated
230:          */
231:         @Override
232:         public String toString() {
233:•                if (eIsProxy()) {
234:                         return super.toString();
235:                 }
236:
237:                 final StringBuffer result = new StringBuffer(super.toString());
238:                 result.append(" (name: "); //$NON-NLS-1$
239:                 result.append(name);
240:                 result.append(')');
241:                 return result.toString();
242:         }
243:
244: } // ChildLevel1Impl