Skip to content

Package: CarImpl

CarImpl

nameinstructionbranchcomplexitylinemethod
CarImpl()
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
basicSetDriver(Driver, NotificationChain)
M: 18 C: 11
38%
M: 3 C: 1
25%
M: 2 C: 1
33%
M: 6 C: 4
40%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 21 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 56 C: 0
0%
M: 21 C: 0
0%
M: 13 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 28 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 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: 22 C: 0
0%
M: 5 C: 0
0%
M: 5 C: 0
0%
M: 11 C: 0
0%
M: 1 C: 0
0%
getDriver()
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%
getLicensePlate()
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%
getManufacturer()
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%
getSeatCount()
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%
setDriver(Driver)
M: 25 C: 27
52%
M: 6 C: 4
40%
M: 5 C: 1
17%
M: 7 C: 10
59%
M: 0 C: 1
100%
setLicensePlate(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 3 C: 4
57%
M: 0 C: 1
100%
setManufacturer(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setSeatCount(int)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
static {...}
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
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: */
3: package car.impl;
4:
5: import org.eclipse.emf.common.notify.Notification;
6: import org.eclipse.emf.common.notify.NotificationChain;
7: import org.eclipse.emf.ecore.EClass;
8: import org.eclipse.emf.ecore.InternalEObject;
9: import org.eclipse.emf.ecore.impl.ENotificationImpl;
10: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
11:
12: import car.Car;
13: import car.CarPackage;
14: import car.Driver;
15:
16: /**
17: * <!-- begin-user-doc --> An implementation of the model object '
18: * <em><b>Car</b></em>'. <!-- end-user-doc -->
19: * <p>
20: * The following features are implemented:
21: * <ul>
22: * <li>{@link car.impl.CarImpl#getManufacturer <em>Manufacturer</em>}</li>
23: * <li>{@link car.impl.CarImpl#getLicensePlate <em>License Plate</em>}</li>
24: * <li>{@link car.impl.CarImpl#getSeatCount <em>Seat Count</em>}</li>
25: * <li>{@link car.impl.CarImpl#getDriver <em>Driver</em>}</li>
26: * </ul>
27: * </p>
28: *
29: * @generated
30: */
31: public class CarImpl extends MinimalEObjectImpl.Container implements Car {
32:         /**
33:          * The default value of the '{@link #getManufacturer()
34:          * <em>Manufacturer</em>}' attribute. <!-- begin-user-doc --> <!--
35:          * end-user-doc -->
36:          *
37:          * @see #getManufacturer()
38:          * @generated
39:          * @ordered
40:          */
41:         protected static final String MANUFACTURER_EDEFAULT = null;
42:
43:         /**
44:          * The cached value of the '{@link #getManufacturer() <em>Manufacturer</em>}
45:          * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
46:          *
47:          * @see #getManufacturer()
48:          * @generated
49:          * @ordered
50:          */
51:         protected String manufacturer = MANUFACTURER_EDEFAULT;
52:
53:         /**
54:          * The default value of the '{@link #getLicensePlate()
55:          * <em>License Plate</em>}' attribute. <!-- begin-user-doc --> <!--
56:          * end-user-doc -->
57:          *
58:          * @see #getLicensePlate()
59:          * @generated
60:          * @ordered
61:          */
62:         protected static final String LICENSE_PLATE_EDEFAULT = null;
63:
64:         /**
65:          * The cached value of the '{@link #getLicensePlate()
66:          * <em>License Plate</em>}' attribute. <!-- begin-user-doc --> <!--
67:          * end-user-doc -->
68:          *
69:          * @see #getLicensePlate()
70:          * @generated
71:          * @ordered
72:          */
73:         protected String licensePlate = LICENSE_PLATE_EDEFAULT;
74:
75:         /**
76:          * The default value of the '{@link #getSeatCount() <em>Seat Count</em>}'
77:          * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
78:          *
79:          * @see #getSeatCount()
80:          * @generated
81:          * @ordered
82:          */
83:         protected static final int SEAT_COUNT_EDEFAULT = 0;
84:
85:         /**
86:          * The cached value of the '{@link #getSeatCount() <em>Seat Count</em>}'
87:          * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
88:          *
89:          * @see #getSeatCount()
90:          * @generated
91:          * @ordered
92:          */
93:         protected int seatCount = SEAT_COUNT_EDEFAULT;
94:
95:         /**
96:          * The cached value of the '{@link #getDriver() <em>Driver</em>}'
97:          * containment reference. <!-- begin-user-doc --> <!-- end-user-doc -->
98:          *
99:          * @see #getDriver()
100:          * @generated
101:          * @ordered
102:          */
103:         protected Driver driver;
104:
105:         /**
106:          * <!-- begin-user-doc --> <!-- end-user-doc -->
107:          *
108:          * @generated
109:          */
110:         protected CarImpl() {
111:                 super();
112:         }
113:
114:         /**
115:          * <!-- begin-user-doc --> <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         protected EClass eStaticClass() {
121:                 return CarPackage.Literals.CAR;
122:         }
123:
124:         /**
125:          * <!-- begin-user-doc --> <!-- end-user-doc -->
126:          *
127:          * @generated
128:          */
129:         @Override
130:         public String getManufacturer() {
131:                 return manufacturer;
132:         }
133:
134:         /**
135:          * <!-- begin-user-doc --> <!-- end-user-doc -->
136:          *
137:          * @generated
138:          */
139:         @Override
140:         public void setManufacturer(String newManufacturer) {
141:                 String oldManufacturer = manufacturer;
142:                 manufacturer = newManufacturer;
143:•                if (eNotificationRequired())
144:                         eNotify(new ENotificationImpl(this, Notification.SET,
145:                                 CarPackage.CAR__MANUFACTURER, oldManufacturer, manufacturer));
146:         }
147:
148:         /**
149:          * <!-- begin-user-doc --> <!-- end-user-doc -->
150:          *
151:          * @generated
152:          */
153:         @Override
154:         public String getLicensePlate() {
155:                 return licensePlate;
156:         }
157:
158:         /**
159:          * <!-- begin-user-doc --> <!-- end-user-doc -->
160:          *
161:          * @generated
162:          */
163:         @Override
164:         public void setLicensePlate(String newLicensePlate) {
165:                 String oldLicensePlate = licensePlate;
166:                 licensePlate = newLicensePlate;
167:•                if (eNotificationRequired())
168:                         eNotify(new ENotificationImpl(this, Notification.SET,
169:                                 CarPackage.CAR__LICENSE_PLATE, oldLicensePlate,
170:                                 licensePlate));
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc --> <!-- end-user-doc -->
175:          *
176:          * @generated
177:          */
178:         @Override
179:         public int getSeatCount() {
180:                 return seatCount;
181:         }
182:
183:         /**
184:          * <!-- begin-user-doc --> <!-- end-user-doc -->
185:          *
186:          * @generated
187:          */
188:         @Override
189:         public void setSeatCount(int newSeatCount) {
190:                 int oldSeatCount = seatCount;
191:                 seatCount = newSeatCount;
192:•                if (eNotificationRequired())
193:                         eNotify(new ENotificationImpl(this, Notification.SET,
194:                                 CarPackage.CAR__SEAT_COUNT, oldSeatCount, seatCount));
195:         }
196:
197:         /**
198:          * <!-- begin-user-doc --> <!-- end-user-doc -->
199:          *
200:          * @generated
201:          */
202:         @Override
203:         public Driver getDriver() {
204:                 return driver;
205:         }
206:
207:         /**
208:          * <!-- begin-user-doc --> <!-- end-user-doc -->
209:          *
210:          * @generated
211:          */
212:         public NotificationChain basicSetDriver(Driver newDriver,
213:                 NotificationChain msgs) {
214:                 Driver oldDriver = driver;
215:                 driver = newDriver;
216:•                if (eNotificationRequired()) {
217:                         ENotificationImpl notification = new ENotificationImpl(this,
218:                                 Notification.SET, CarPackage.CAR__DRIVER, oldDriver,
219:                                 newDriver);
220:•                        if (msgs == null)
221:                                 msgs = notification;
222:                         else
223:                                 msgs.add(notification);
224:                 }
225:                 return msgs;
226:         }
227:
228:         /**
229:          * <!-- begin-user-doc --> <!-- end-user-doc -->
230:          *
231:          * @generated
232:          */
233:         @Override
234:         public void setDriver(Driver newDriver) {
235:•                if (newDriver != driver) {
236:                         NotificationChain msgs = null;
237:•                        if (driver != null)
238:                                 msgs = ((InternalEObject) driver).eInverseRemove(this,
239:                                         EOPPOSITE_FEATURE_BASE - CarPackage.CAR__DRIVER, null,
240:                                         msgs);
241:•                        if (newDriver != null)
242:                                 msgs = ((InternalEObject) newDriver).eInverseAdd(this,
243:                                         EOPPOSITE_FEATURE_BASE - CarPackage.CAR__DRIVER, null,
244:                                         msgs);
245:                         msgs = basicSetDriver(newDriver, msgs);
246:•                        if (msgs != null)
247:                                 msgs.dispatch();
248:•                } else if (eNotificationRequired())
249:                         eNotify(new ENotificationImpl(this, Notification.SET,
250:                                 CarPackage.CAR__DRIVER, newDriver, newDriver));
251:         }
252:
253:         /**
254:          * <!-- begin-user-doc --> <!-- end-user-doc -->
255:          *
256:          * @generated
257:          */
258:         @Override
259:         public NotificationChain eInverseRemove(InternalEObject otherEnd,
260:                 int featureID, NotificationChain msgs) {
261:•                switch (featureID) {
262:                 case CarPackage.CAR__DRIVER:
263:                         return basicSetDriver(null, msgs);
264:                 }
265:                 return super.eInverseRemove(otherEnd, featureID, msgs);
266:         }
267:
268:         /**
269:          * <!-- begin-user-doc --> <!-- end-user-doc -->
270:          *
271:          * @generated
272:          */
273:         @Override
274:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
275:•                switch (featureID) {
276:                 case CarPackage.CAR__MANUFACTURER:
277:                         return getManufacturer();
278:                 case CarPackage.CAR__LICENSE_PLATE:
279:                         return getLicensePlate();
280:                 case CarPackage.CAR__SEAT_COUNT:
281:                         return getSeatCount();
282:                 case CarPackage.CAR__DRIVER:
283:                         return getDriver();
284:                 }
285:                 return super.eGet(featureID, resolve, coreType);
286:         }
287:
288:         /**
289:          * <!-- begin-user-doc --> <!-- end-user-doc -->
290:          *
291:          * @generated
292:          */
293:         @Override
294:         public void eSet(int featureID, Object newValue) {
295:•                switch (featureID) {
296:                 case CarPackage.CAR__MANUFACTURER:
297:                         setManufacturer((String) newValue);
298:                         return;
299:                 case CarPackage.CAR__LICENSE_PLATE:
300:                         setLicensePlate((String) newValue);
301:                         return;
302:                 case CarPackage.CAR__SEAT_COUNT:
303:                         setSeatCount((Integer) newValue);
304:                         return;
305:                 case CarPackage.CAR__DRIVER:
306:                         setDriver((Driver) newValue);
307:                         return;
308:                 }
309:                 super.eSet(featureID, newValue);
310:         }
311:
312:         /**
313:          * <!-- begin-user-doc --> <!-- end-user-doc -->
314:          *
315:          * @generated
316:          */
317:         @Override
318:         public void eUnset(int featureID) {
319:•                switch (featureID) {
320:                 case CarPackage.CAR__MANUFACTURER:
321:                         setManufacturer(MANUFACTURER_EDEFAULT);
322:                         return;
323:                 case CarPackage.CAR__LICENSE_PLATE:
324:                         setLicensePlate(LICENSE_PLATE_EDEFAULT);
325:                         return;
326:                 case CarPackage.CAR__SEAT_COUNT:
327:                         setSeatCount(SEAT_COUNT_EDEFAULT);
328:                         return;
329:                 case CarPackage.CAR__DRIVER:
330:                         setDriver((Driver) null);
331:                         return;
332:                 }
333:                 super.eUnset(featureID);
334:         }
335:
336:         /**
337:          * <!-- begin-user-doc --> <!-- end-user-doc -->
338:          *
339:          * @generated
340:          */
341:         @Override
342:         public boolean eIsSet(int featureID) {
343:•                switch (featureID) {
344:                 case CarPackage.CAR__MANUFACTURER:
345:•                        return MANUFACTURER_EDEFAULT == null ? manufacturer != null
346:•                                : !MANUFACTURER_EDEFAULT.equals(manufacturer);
347:                 case CarPackage.CAR__LICENSE_PLATE:
348:•                        return LICENSE_PLATE_EDEFAULT == null ? licensePlate != null
349:•                                : !LICENSE_PLATE_EDEFAULT.equals(licensePlate);
350:                 case CarPackage.CAR__SEAT_COUNT:
351:•                        return seatCount != SEAT_COUNT_EDEFAULT;
352:                 case CarPackage.CAR__DRIVER:
353:•                        return driver != null;
354:                 }
355:                 return super.eIsSet(featureID);
356:         }
357:
358:         /**
359:          * <!-- begin-user-doc --> <!-- end-user-doc -->
360:          *
361:          * @generated
362:          */
363:         @Override
364:         public String toString() {
365:•                if (eIsProxy())
366:                         return super.toString();
367:
368:                 StringBuffer result = new StringBuffer(super.toString());
369:                 result.append(" (manufacturer: ");
370:                 result.append(manufacturer);
371:                 result.append(", licensePlate: ");
372:                 result.append(licensePlate);
373:                 result.append(", seatCount: ");
374:                 result.append(seatCount);
375:                 result.append(')');
376:                 return result.toString();
377:         }
378:
379: } // CarImpl