Skip to content

Package: DimensionImpl

DimensionImpl

nameinstructionbranchcomplexitylinemethod
DimensionImpl()
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 20 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 27 C: 0
0%
M: 10 C: 0
0%
M: 7 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 25 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
eStaticClass()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
eUnset(int)
M: 18 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getHeight()
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%
getLength()
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%
getWidth()
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%
setHeight(int)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setLength(int)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setWidth(int)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
toString()
M: 46 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 11 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 Munich - initial API and implementation
13: */
14: package org.eclipse.emfforms.coffee.model.coffee.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.emfforms.coffee.model.coffee.CoffeePackage;
21: import org.eclipse.emfforms.coffee.model.coffee.Dimension;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * An implementation of the model object '<em><b>Dimension</b></em>'.
26: * <!-- end-user-doc -->
27: * <p>
28: * The following features are implemented:
29: * </p>
30: * <ul>
31: * <li>{@link org.eclipse.emfforms.coffee.model.coffee.impl.DimensionImpl#getWidth <em>Width</em>}</li>
32: * <li>{@link org.eclipse.emfforms.coffee.model.coffee.impl.DimensionImpl#getHeight <em>Height</em>}</li>
33: * <li>{@link org.eclipse.emfforms.coffee.model.coffee.impl.DimensionImpl#getLength <em>Length</em>}</li>
34: * </ul>
35: *
36: * @generated
37: */
38: public class DimensionImpl extends MinimalEObjectImpl.Container implements Dimension {
39:         /**
40:          * The default value of the '{@link #getWidth() <em>Width</em>}' attribute.
41:          * <!-- begin-user-doc -->
42:          * <!-- end-user-doc -->
43:          *
44:          * @see #getWidth()
45:          * @generated
46:          * @ordered
47:          */
48:         protected static final int WIDTH_EDEFAULT = 0;
49:
50:         /**
51:          * The cached value of the '{@link #getWidth() <em>Width</em>}' attribute.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @see #getWidth()
56:          * @generated
57:          * @ordered
58:          */
59:         protected int width = WIDTH_EDEFAULT;
60:
61:         /**
62:          * The default value of the '{@link #getHeight() <em>Height</em>}' attribute.
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @see #getHeight()
67:          * @generated
68:          * @ordered
69:          */
70:         protected static final int HEIGHT_EDEFAULT = 0;
71:
72:         /**
73:          * The cached value of the '{@link #getHeight() <em>Height</em>}' attribute.
74:          * <!-- begin-user-doc -->
75:          * <!-- end-user-doc -->
76:          *
77:          * @see #getHeight()
78:          * @generated
79:          * @ordered
80:          */
81:         protected int height = HEIGHT_EDEFAULT;
82:
83:         /**
84:          * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @see #getLength()
89:          * @generated
90:          * @ordered
91:          */
92:         protected static final int LENGTH_EDEFAULT = 0;
93:
94:         /**
95:          * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
96:          * <!-- begin-user-doc -->
97:          * <!-- end-user-doc -->
98:          *
99:          * @see #getLength()
100:          * @generated
101:          * @ordered
102:          */
103:         protected int length = LENGTH_EDEFAULT;
104:
105:         /**
106:          * <!-- begin-user-doc -->
107:          * <!-- end-user-doc -->
108:          *
109:          * @generated
110:          */
111:         protected DimensionImpl() {
112:                 super();
113:         }
114:
115:         /**
116:          * <!-- begin-user-doc -->
117:          * <!-- end-user-doc -->
118:          *
119:          * @generated
120:          */
121:         @Override
122:         protected EClass eStaticClass() {
123:                 return CoffeePackage.Literals.DIMENSION;
124:         }
125:
126:         /**
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @generated
131:          */
132:         @Override
133:         public int getWidth() {
134:                 return width;
135:         }
136:
137:         /**
138:          * <!-- begin-user-doc -->
139:          * <!-- end-user-doc -->
140:          *
141:          * @generated
142:          */
143:         @Override
144:         public void setWidth(int newWidth) {
145:                 final int oldWidth = width;
146:                 width = newWidth;
147:•                if (eNotificationRequired()) {
148:                         eNotify(new ENotificationImpl(this, Notification.SET, CoffeePackage.DIMENSION__WIDTH, oldWidth, width));
149:                 }
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @generated
157:          */
158:         @Override
159:         public int getHeight() {
160:                 return height;
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @generated
168:          */
169:         @Override
170:         public void setHeight(int newHeight) {
171:                 final int oldHeight = height;
172:                 height = newHeight;
173:•                if (eNotificationRequired()) {
174:                         eNotify(new ENotificationImpl(this, Notification.SET, CoffeePackage.DIMENSION__HEIGHT, oldHeight, height));
175:                 }
176:         }
177:
178:         /**
179:          * <!-- begin-user-doc -->
180:          * <!-- end-user-doc -->
181:          *
182:          * @generated
183:          */
184:         @Override
185:         public int getLength() {
186:                 return length;
187:         }
188:
189:         /**
190:          * <!-- begin-user-doc -->
191:          * <!-- end-user-doc -->
192:          *
193:          * @generated
194:          */
195:         @Override
196:         public void setLength(int newLength) {
197:                 final int oldLength = length;
198:                 length = newLength;
199:•                if (eNotificationRequired()) {
200:                         eNotify(new ENotificationImpl(this, Notification.SET, CoffeePackage.DIMENSION__LENGTH, oldLength, length));
201:                 }
202:         }
203:
204:         /**
205:          * <!-- begin-user-doc -->
206:          * <!-- end-user-doc -->
207:          *
208:          * @generated
209:          */
210:         @Override
211:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
212:•                switch (featureID) {
213:                 case CoffeePackage.DIMENSION__WIDTH:
214:                         return getWidth();
215:                 case CoffeePackage.DIMENSION__HEIGHT:
216:                         return getHeight();
217:                 case CoffeePackage.DIMENSION__LENGTH:
218:                         return getLength();
219:                 }
220:                 return super.eGet(featureID, resolve, coreType);
221:         }
222:
223:         /**
224:          * <!-- begin-user-doc -->
225:          * <!-- end-user-doc -->
226:          *
227:          * @generated
228:          */
229:         @Override
230:         public void eSet(int featureID, Object newValue) {
231:•                switch (featureID) {
232:                 case CoffeePackage.DIMENSION__WIDTH:
233:                         setWidth((Integer) newValue);
234:                         return;
235:                 case CoffeePackage.DIMENSION__HEIGHT:
236:                         setHeight((Integer) newValue);
237:                         return;
238:                 case CoffeePackage.DIMENSION__LENGTH:
239:                         setLength((Integer) newValue);
240:                         return;
241:                 }
242:                 super.eSet(featureID, newValue);
243:         }
244:
245:         /**
246:          * <!-- begin-user-doc -->
247:          * <!-- end-user-doc -->
248:          *
249:          * @generated
250:          */
251:         @Override
252:         public void eUnset(int featureID) {
253:•                switch (featureID) {
254:                 case CoffeePackage.DIMENSION__WIDTH:
255:                         setWidth(WIDTH_EDEFAULT);
256:                         return;
257:                 case CoffeePackage.DIMENSION__HEIGHT:
258:                         setHeight(HEIGHT_EDEFAULT);
259:                         return;
260:                 case CoffeePackage.DIMENSION__LENGTH:
261:                         setLength(LENGTH_EDEFAULT);
262:                         return;
263:                 }
264:                 super.eUnset(featureID);
265:         }
266:
267:         /**
268:          * <!-- begin-user-doc -->
269:          * <!-- end-user-doc -->
270:          *
271:          * @generated
272:          */
273:         @Override
274:         public boolean eIsSet(int featureID) {
275:•                switch (featureID) {
276:                 case CoffeePackage.DIMENSION__WIDTH:
277:•                        return width != WIDTH_EDEFAULT;
278:                 case CoffeePackage.DIMENSION__HEIGHT:
279:•                        return height != HEIGHT_EDEFAULT;
280:                 case CoffeePackage.DIMENSION__LENGTH:
281:•                        return length != LENGTH_EDEFAULT;
282:                 }
283:                 return super.eIsSet(featureID);
284:         }
285:
286:         /**
287:          * <!-- begin-user-doc -->
288:          * <!-- end-user-doc -->
289:          *
290:          * @generated
291:          */
292:         @Override
293:         public String toString() {
294:•                if (eIsProxy()) {
295:                         return super.toString();
296:                 }
297:
298:                 final StringBuffer result = new StringBuffer(super.toString());
299:                 result.append(" (width: "); //$NON-NLS-1$
300:                 result.append(width);
301:                 result.append(", height: "); //$NON-NLS-1$
302:                 result.append(height);
303:                 result.append(", length: "); //$NON-NLS-1$
304:                 result.append(length);
305:                 result.append(')');
306:                 return result.toString();
307:         }
308:
309: } // DimensionImpl