Skip to content

Package: RootImpl

RootImpl

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