Skip to content

Package: ContentImpl

ContentImpl

nameinstructionbranchcomplexitylinemethod
ContentImpl()
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%
eGet(int, boolean, boolean)
M: 9 C: 5
36%
M: 2 C: 1
33%
M: 2 C: 1
33%
M: 2 C: 2
50%
M: 0 C: 1
100%
eIsSet(int)
M: 24 C: 18
43%
M: 9 C: 6
40%
M: 7 C: 2
22%
M: 3 C: 3
50%
M: 0 C: 1
100%
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: 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%
getSecondAttribute()
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%
getUniqueAttribute()
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%
setSecondAttribute(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%
setUniqueAttribute(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: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
toString()
M: 37 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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.validation.test.model.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.EObjectImpl;
20: import org.eclipse.emf.ecp.view.validation.test.model.Content;
21: import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * An implementation of the model object '<em><b>Content</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.view.validation.test.model.impl.ContentImpl#getUniqueAttribute
32: * <em>Unique Attribute</em>}</li>
33: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.ContentImpl#getSecondAttribute
34: * <em>Second Attribute</em>}</li>
35: * </ul>
36: *
37: * @generated
38: */
39: public class ContentImpl extends EObjectImpl implements Content {
40:         /**
41:          * The default value of the '{@link #getUniqueAttribute() <em>Unique Attribute</em>}' attribute.
42:          * <!-- begin-user-doc -->
43:          * <!-- end-user-doc -->
44:          *
45:          * @see #getUniqueAttribute()
46:          * @generated
47:          * @ordered
48:          */
49:         protected static final String UNIQUE_ATTRIBUTE_EDEFAULT = null;
50:
51:         /**
52:          * The cached value of the '{@link #getUniqueAttribute() <em>Unique Attribute</em>}' attribute.
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @see #getUniqueAttribute()
57:          * @generated
58:          * @ordered
59:          */
60:         protected String uniqueAttribute = UNIQUE_ATTRIBUTE_EDEFAULT;
61:
62:         /**
63:          * The default value of the '{@link #getSecondAttribute() <em>Second Attribute</em>}' attribute.
64:          * <!-- begin-user-doc -->
65:          * <!-- end-user-doc -->
66:          *
67:          * @see #getSecondAttribute()
68:          * @generated
69:          * @ordered
70:          */
71:         protected static final String SECOND_ATTRIBUTE_EDEFAULT = null;
72:
73:         /**
74:          * The cached value of the '{@link #getSecondAttribute() <em>Second Attribute</em>}' attribute.
75:          * <!-- begin-user-doc -->
76:          * <!-- end-user-doc -->
77:          *
78:          * @see #getSecondAttribute()
79:          * @generated
80:          * @ordered
81:          */
82:         protected String secondAttribute = SECOND_ATTRIBUTE_EDEFAULT;
83:
84:         /**
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @generated
89:          */
90:         protected ContentImpl() {
91:                 super();
92:         }
93:
94:         /**
95:          * <!-- begin-user-doc -->
96:          * <!-- end-user-doc -->
97:          *
98:          * @generated
99:          */
100:         @Override
101:         protected EClass eStaticClass() {
102:                 return TestPackage.Literals.CONTENT;
103:         }
104:
105:         /**
106:          * <!-- begin-user-doc -->
107:          * <!-- end-user-doc -->
108:          *
109:          * @generated
110:          */
111:         @Override
112:         public String getUniqueAttribute() {
113:                 return uniqueAttribute;
114:         }
115:
116:         /**
117:          * <!-- begin-user-doc -->
118:          * <!-- end-user-doc -->
119:          *
120:          * @generated
121:          */
122:         @Override
123:         public void setUniqueAttribute(String newUniqueAttribute) {
124:                 final String oldUniqueAttribute = uniqueAttribute;
125:                 uniqueAttribute = newUniqueAttribute;
126:•                if (eNotificationRequired()) {
127:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.CONTENT__UNIQUE_ATTRIBUTE,
128:                                 oldUniqueAttribute, uniqueAttribute));
129:                 }
130:         }
131:
132:         /**
133:          * <!-- begin-user-doc -->
134:          * <!-- end-user-doc -->
135:          *
136:          * @generated
137:          */
138:         @Override
139:         public String getSecondAttribute() {
140:                 return secondAttribute;
141:         }
142:
143:         /**
144:          * <!-- begin-user-doc -->
145:          * <!-- end-user-doc -->
146:          *
147:          * @generated
148:          */
149:         @Override
150:         public void setSecondAttribute(String newSecondAttribute) {
151:                 final String oldSecondAttribute = secondAttribute;
152:                 secondAttribute = newSecondAttribute;
153:•                if (eNotificationRequired()) {
154:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.CONTENT__SECOND_ATTRIBUTE,
155:                                 oldSecondAttribute, secondAttribute));
156:                 }
157:         }
158:
159:         /**
160:          * <!-- begin-user-doc -->
161:          * <!-- end-user-doc -->
162:          *
163:          * @generated
164:          */
165:         @Override
166:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
167:•                switch (featureID) {
168:                 case TestPackage.CONTENT__UNIQUE_ATTRIBUTE:
169:                         return getUniqueAttribute();
170:                 case TestPackage.CONTENT__SECOND_ATTRIBUTE:
171:                         return getSecondAttribute();
172:                 }
173:                 return super.eGet(featureID, resolve, coreType);
174:         }
175:
176:         /**
177:          * <!-- begin-user-doc -->
178:          * <!-- end-user-doc -->
179:          *
180:          * @generated
181:          */
182:         @Override
183:         public void eSet(int featureID, Object newValue) {
184:•                switch (featureID) {
185:                 case TestPackage.CONTENT__UNIQUE_ATTRIBUTE:
186:                         setUniqueAttribute((String) newValue);
187:                         return;
188:                 case TestPackage.CONTENT__SECOND_ATTRIBUTE:
189:                         setSecondAttribute((String) newValue);
190:                         return;
191:                 }
192:                 super.eSet(featureID, newValue);
193:         }
194:
195:         /**
196:          * <!-- begin-user-doc -->
197:          * <!-- end-user-doc -->
198:          *
199:          * @generated
200:          */
201:         @Override
202:         public void eUnset(int featureID) {
203:•                switch (featureID) {
204:                 case TestPackage.CONTENT__UNIQUE_ATTRIBUTE:
205:                         setUniqueAttribute(UNIQUE_ATTRIBUTE_EDEFAULT);
206:                         return;
207:                 case TestPackage.CONTENT__SECOND_ATTRIBUTE:
208:                         setSecondAttribute(SECOND_ATTRIBUTE_EDEFAULT);
209:                         return;
210:                 }
211:                 super.eUnset(featureID);
212:         }
213:
214:         /**
215:          * <!-- begin-user-doc -->
216:          * <!-- end-user-doc -->
217:          *
218:          * @generated
219:          */
220:         @Override
221:         public boolean eIsSet(int featureID) {
222:•                switch (featureID) {
223:                 case TestPackage.CONTENT__UNIQUE_ATTRIBUTE:
224:•                        return UNIQUE_ATTRIBUTE_EDEFAULT == null ? uniqueAttribute != null
225:•                                : !UNIQUE_ATTRIBUTE_EDEFAULT.equals(uniqueAttribute);
226:                 case TestPackage.CONTENT__SECOND_ATTRIBUTE:
227:•                        return SECOND_ATTRIBUTE_EDEFAULT == null ? secondAttribute != null
228:•                                : !SECOND_ATTRIBUTE_EDEFAULT.equals(secondAttribute);
229:                 }
230:                 return super.eIsSet(featureID);
231:         }
232:
233:         /**
234:          * <!-- begin-user-doc -->
235:          * <!-- end-user-doc -->
236:          *
237:          * @generated
238:          */
239:         @Override
240:         public String toString() {
241:•                if (eIsProxy()) {
242:                         return super.toString();
243:                 }
244:
245:                 final StringBuffer result = new StringBuffer(super.toString());
246:                 result.append(" (uniqueAttribute: ");
247:                 result.append(uniqueAttribute);
248:                 result.append(", secondAttribute: ");
249:                 result.append(secondAttribute);
250:                 result.append(')');
251:                 return result.toString();
252:         }
253:
254: } // ContentImpl