Skip to content

Package: DImpl

DImpl

nameinstructionbranchcomplexitylinemethod
DImpl()
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%
eIsSet(int)
M: 35 C: 0
0%
M: 13 C: 0
0%
M: 8 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 15 C: 7
32%
M: 2 C: 1
33%
M: 2 C: 1
33%
M: 5 C: 3
38%
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: 14 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getX()
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%
getYList()
M: 0 C: 14
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%
setX(String)
M: 0 C: 21
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
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: 3 C: 34
92%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 8
89%
M: 0 C: 1
100%

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 java.util.Collection;
17:
18: import org.eclipse.emf.common.notify.Notification;
19: import org.eclipse.emf.common.util.EList;
20: import org.eclipse.emf.ecore.EClass;
21: import org.eclipse.emf.ecore.impl.ENotificationImpl;
22: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
23: import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
24: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.D;
25: import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * An implementation of the model object '<em><b>D</b></em>'.
30: * <!-- end-user-doc -->
31: * <p>
32: * The following features are implemented:
33: * </p>
34: * <ul>
35: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.DImpl#getX <em>X</em>}</li>
36: * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.DImpl#getYList
37: * <em>YList</em>}</li>
38: * </ul>
39: *
40: * @generated
41: */
42: public class DImpl extends MinimalEObjectImpl.Container implements D {
43:         /**
44:          * The default value of the '{@link #getX() <em>X</em>}' attribute.
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @see #getX()
49:          * @generated
50:          * @ordered
51:          */
52:         protected static final String X_EDEFAULT = null;
53:
54:         /**
55:          * The cached value of the '{@link #getX() <em>X</em>}' attribute.
56:          * <!-- begin-user-doc -->
57:          * <!-- end-user-doc -->
58:          *
59:          * @see #getX()
60:          * @generated
61:          * @ordered
62:          */
63:         protected String x = X_EDEFAULT;
64:
65:         /**
66:          * The cached value of the '{@link #getYList() <em>YList</em>}' attribute list.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @see #getYList()
71:          * @generated
72:          * @ordered
73:          */
74:         protected EList<Integer> yList;
75:
76:         /**
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @generated
81:          */
82:         protected DImpl() {
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.D;
95:         }
96:
97:         /**
98:          * <!-- begin-user-doc -->
99:          * <!-- end-user-doc -->
100:          *
101:          * @generated
102:          */
103:         @Override
104:         public String getX() {
105:                 return x;
106:         }
107:
108:         /**
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         @Override
115:         public void setX(String newX) {
116:                 final String oldX = x;
117:                 x = newX;
118:•                if (eNotificationRequired()) {
119:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.D__X, oldX, x));
120:                 }
121:         }
122:
123:         /**
124:          * <!-- begin-user-doc -->
125:          * <!-- end-user-doc -->
126:          *
127:          * @generated
128:          */
129:         @Override
130:         public EList<Integer> getYList() {
131:•                if (yList == null) {
132:                         yList = new EDataTypeUniqueEList<>(Integer.class, this, TestPackage.D__YLIST);
133:                 }
134:                 return yList;
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
145:•                switch (featureID) {
146:                 case TestPackage.D__X:
147:                         return getX();
148:                 case TestPackage.D__YLIST:
149:                         return getYList();
150:                 }
151:                 return super.eGet(featureID, resolve, coreType);
152:         }
153:
154:         /**
155:          * <!-- begin-user-doc -->
156:          * <!-- end-user-doc -->
157:          *
158:          * @generated
159:          */
160:         @SuppressWarnings("unchecked")
161:         @Override
162:         public void eSet(int featureID, Object newValue) {
163:•                switch (featureID) {
164:                 case TestPackage.D__X:
165:                         setX((String) newValue);
166:                         return;
167:                 case TestPackage.D__YLIST:
168:                         getYList().clear();
169:                         getYList().addAll((Collection<? extends Integer>) newValue);
170:                         return;
171:                 }
172:                 super.eSet(featureID, newValue);
173:         }
174:
175:         /**
176:          * <!-- begin-user-doc -->
177:          * <!-- end-user-doc -->
178:          *
179:          * @generated
180:          */
181:         @Override
182:         public void eUnset(int featureID) {
183:•                switch (featureID) {
184:                 case TestPackage.D__X:
185:                         setX(X_EDEFAULT);
186:                         return;
187:                 case TestPackage.D__YLIST:
188:                         getYList().clear();
189:                         return;
190:                 }
191:                 super.eUnset(featureID);
192:         }
193:
194:         /**
195:          * <!-- begin-user-doc -->
196:          * <!-- end-user-doc -->
197:          *
198:          * @generated
199:          */
200:         @Override
201:         public boolean eIsSet(int featureID) {
202:•                switch (featureID) {
203:                 case TestPackage.D__X:
204:•                        return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x);
205:                 case TestPackage.D__YLIST:
206:•                        return yList != null && !yList.isEmpty();
207:                 }
208:                 return super.eIsSet(featureID);
209:         }
210:
211:         /**
212:          * <!-- begin-user-doc -->
213:          * <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         @Override
218:         public String toString() {
219:•                if (eIsProxy()) {
220:                         return super.toString();
221:                 }
222:
223:                 final StringBuilder result = new StringBuilder(super.toString());
224:                 result.append(" (x: "); //$NON-NLS-1$
225:                 result.append(x);
226:                 result.append(", yList: "); //$NON-NLS-1$
227:                 result.append(yList);
228:                 result.append(')');
229:                 return result.toString();
230:         }
231:
232: } // DImpl