Skip to content

Package: RAMImpl

RAMImpl

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