Skip to content

Package: CarPackageImpl

CarPackageImpl

nameinstructionbranchcomplexitylinemethod
CarPackageImpl()
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 62
98%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 14
93%
M: 0 C: 1
100%
getCar()
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%
getCarFactory()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getCar_Driver()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCar_LicensePlate()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCar_Manufacturer()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCar_SeatCount()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getDriver()
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%
getDriver_Age()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPerson()
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%
getPerson_BirthPlace()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPerson_Children()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getPerson_Name()
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
init()
M: 9 C: 27
75%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 10
83%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 227
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 45
98%
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%

Coverage

1: /**
2: */
3: package car.impl;
4:
5: import org.eclipse.emf.ecore.EAttribute;
6: import org.eclipse.emf.ecore.EClass;
7: import org.eclipse.emf.ecore.EPackage;
8: import org.eclipse.emf.ecore.EReference;
9: import org.eclipse.emf.ecore.impl.EPackageImpl;
10:
11: import car.Car;
12: import car.CarFactory;
13: import car.CarPackage;
14: import car.Driver;
15: import car.Person;
16:
17: /**
18: * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!--
19: * end-user-doc -->
20: *
21: * @generated
22: */
23: public class CarPackageImpl extends EPackageImpl implements CarPackage {
24:         /**
25:          * <!-- begin-user-doc --> <!-- end-user-doc -->
26:          *
27:          * @generated
28:          */
29:         private EClass personEClass = null;
30:
31:         /**
32:          * <!-- begin-user-doc --> <!-- end-user-doc -->
33:          *
34:          * @generated
35:          */
36:         private EClass driverEClass = null;
37:
38:         /**
39:          * <!-- begin-user-doc --> <!-- end-user-doc -->
40:          *
41:          * @generated
42:          */
43:         private EClass carEClass = null;
44:
45:         /**
46:          * Creates an instance of the model <b>Package</b>, registered with
47:          * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the
48:          * package package URI value.
49:          * <p>
50:          * Note: the correct way to create the package is via the static factory
51:          * method {@link #init init()}, which also performs initialization of the
52:          * package, or returns the registered package, if one already exists. <!--
53:          * begin-user-doc --> <!-- end-user-doc -->
54:          *
55:          * @see org.eclipse.emf.ecore.EPackage.Registry
56:          * @see car.CarPackage#eNS_URI
57:          * @see #init()
58:          * @generated
59:          */
60:         private CarPackageImpl() {
61:                 super(eNS_URI, CarFactory.eINSTANCE);
62:         }
63:
64:         /**
65:          * <!-- begin-user-doc --> <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         private static boolean isInited = false;
70:
71:         /**
72:          * Creates, registers, and initializes the <b>Package</b> for this model,
73:          * and for any others upon which it depends.
74:          *
75:          * <p>
76:          * This method is used to initialize {@link CarPackage#eINSTANCE} when that
77:          * field is accessed. Clients should not invoke it directly. Instead, they
78:          * should simply access that field to obtain the package. <!--
79:          * begin-user-doc --> <!-- end-user-doc -->
80:          *
81:          * @see #eNS_URI
82:          * @see #createPackageContents()
83:          * @see #initializePackageContents()
84:          * @generated
85:          */
86:         public static CarPackage init() {
87:•                if (isInited)
88:                         return (CarPackage) EPackage.Registry.INSTANCE
89:                                 .getEPackage(CarPackage.eNS_URI);
90:
91:                 // Obtain or create and register package
92:                 CarPackageImpl theCarPackage = (CarPackageImpl) (EPackage.Registry.INSTANCE
93:•                        .get(eNS_URI) instanceof CarPackageImpl ? EPackage.Registry.INSTANCE
94:                                 .get(eNS_URI) : new CarPackageImpl());
95:
96:                 isInited = true;
97:
98:                 // Create package meta-data objects
99:                 theCarPackage.createPackageContents();
100:
101:                 // Initialize created meta-data
102:                 theCarPackage.initializePackageContents();
103:
104:                 // Mark meta-data to indicate it can't be changed
105:                 theCarPackage.freeze();
106:
107:                 // Update the registry and return the package
108:                 EPackage.Registry.INSTANCE.put(CarPackage.eNS_URI, theCarPackage);
109:                 return theCarPackage;
110:         }
111:
112:         /**
113:          * <!-- begin-user-doc --> <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public EClass getPerson() {
119:                 return personEClass;
120:         }
121:
122:         /**
123:          * <!-- begin-user-doc --> <!-- end-user-doc -->
124:          *
125:          * @generated
126:          */
127:         @Override
128:         public EAttribute getPerson_Name() {
129:                 return (EAttribute) personEClass.getEStructuralFeatures().get(0);
130:         }
131:
132:         /**
133:          * <!-- begin-user-doc --> <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         @Override
138:         public EReference getPerson_Children() {
139:                 return (EReference) personEClass.getEStructuralFeatures().get(1);
140:         }
141:
142:         /**
143:          * <!-- begin-user-doc --> <!-- end-user-doc -->
144:          *
145:          * @generated
146:          */
147:         @Override
148:         public EAttribute getPerson_BirthPlace() {
149:                 return (EAttribute) personEClass.getEStructuralFeatures().get(2);
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc --> <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public EClass getDriver() {
159:                 return driverEClass;
160:         }
161:
162:         /**
163:          * <!-- begin-user-doc --> <!-- end-user-doc -->
164:          *
165:          * @generated
166:          */
167:         @Override
168:         public EAttribute getDriver_Age() {
169:                 return (EAttribute) driverEClass.getEStructuralFeatures().get(0);
170:         }
171:
172:         /**
173:          * <!-- begin-user-doc --> <!-- end-user-doc -->
174:          *
175:          * @generated
176:          */
177:         @Override
178:         public EClass getCar() {
179:                 return carEClass;
180:         }
181:
182:         /**
183:          * <!-- begin-user-doc --> <!-- end-user-doc -->
184:          *
185:          * @generated
186:          */
187:         @Override
188:         public EAttribute getCar_Manufacturer() {
189:                 return (EAttribute) carEClass.getEStructuralFeatures().get(0);
190:         }
191:
192:         /**
193:          * <!-- begin-user-doc --> <!-- end-user-doc -->
194:          *
195:          * @generated
196:          */
197:         @Override
198:         public EAttribute getCar_LicensePlate() {
199:                 return (EAttribute) carEClass.getEStructuralFeatures().get(1);
200:         }
201:
202:         /**
203:          * <!-- begin-user-doc --> <!-- end-user-doc -->
204:          *
205:          * @generated
206:          */
207:         @Override
208:         public EAttribute getCar_SeatCount() {
209:                 return (EAttribute) carEClass.getEStructuralFeatures().get(2);
210:         }
211:
212:         /**
213:          * <!-- begin-user-doc --> <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         @Override
218:         public EReference getCar_Driver() {
219:                 return (EReference) carEClass.getEStructuralFeatures().get(3);
220:         }
221:
222:         /**
223:          * <!-- begin-user-doc --> <!-- end-user-doc -->
224:          *
225:          * @generated
226:          */
227:         @Override
228:         public CarFactory getCarFactory() {
229:                 return (CarFactory) getEFactoryInstance();
230:         }
231:
232:         /**
233:          * <!-- begin-user-doc --> <!-- end-user-doc -->
234:          *
235:          * @generated
236:          */
237:         private boolean isCreated = false;
238:
239:         /**
240:          * Creates the meta-model objects for the package. This method is guarded to
241:          * have no affect on any invocation but its first. <!-- begin-user-doc -->
242:          * <!-- end-user-doc -->
243:          *
244:          * @generated
245:          */
246:         public void createPackageContents() {
247:•                if (isCreated)
248:                         return;
249:                 isCreated = true;
250:
251:                 // Create classes and their features
252:                 personEClass = createEClass(PERSON);
253:                 createEAttribute(personEClass, PERSON__NAME);
254:                 createEReference(personEClass, PERSON__CHILDREN);
255:                 createEAttribute(personEClass, PERSON__BIRTH_PLACE);
256:
257:                 driverEClass = createEClass(DRIVER);
258:                 createEAttribute(driverEClass, DRIVER__AGE);
259:
260:                 carEClass = createEClass(CAR);
261:                 createEAttribute(carEClass, CAR__MANUFACTURER);
262:                 createEAttribute(carEClass, CAR__LICENSE_PLATE);
263:                 createEAttribute(carEClass, CAR__SEAT_COUNT);
264:                 createEReference(carEClass, CAR__DRIVER);
265:         }
266:
267:         /**
268:          * <!-- begin-user-doc --> <!-- end-user-doc -->
269:          *
270:          * @generated
271:          */
272:         private boolean isInitialized = false;
273:
274:         /**
275:          * Complete the initialization of the package and its meta-model. This
276:          * method is guarded to have no affect on any invocation but its first. <!--
277:          * begin-user-doc --> <!-- end-user-doc -->
278:          *
279:          * @generated
280:          */
281:         public void initializePackageContents() {
282:•                if (isInitialized)
283:                         return;
284:                 isInitialized = true;
285:
286:                 // Initialize package
287:                 setName(eNAME);
288:                 setNsPrefix(eNS_PREFIX);
289:                 setNsURI(eNS_URI);
290:
291:                 // Create type parameters
292:
293:                 // Set bounds for type parameters
294:
295:                 // Add supertypes to classes
296:                 driverEClass.getESuperTypes().add(this.getPerson());
297:
298:                 // Initialize classes, features, and operations; add parameters
299:                 initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT,
300:                         !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
301:                 initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name",
302:                         null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE,
303:                         IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
304:                         IS_ORDERED);
305:                 initEReference(getPerson_Children(), this.getPerson(), null,
306:                         "children", null, 0, -1, Person.class, !IS_TRANSIENT,
307:                         !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
308:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
309:                 initEAttribute(getPerson_BirthPlace(), ecorePackage.getEString(),
310:                         "birthPlace", null, 0, 1, Person.class, !IS_TRANSIENT,
311:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
312:                         !IS_DERIVED, IS_ORDERED);
313:
314:                 initEClass(driverEClass, Driver.class, "Driver", !IS_ABSTRACT,
315:                         !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
316:                 initEAttribute(getDriver_Age(), ecorePackage.getEInt(), "age", null, 0,
317:                         1, Driver.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
318:                         !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
319:
320:                 initEClass(carEClass, Car.class, "Car", !IS_ABSTRACT, !IS_INTERFACE,
321:                         IS_GENERATED_INSTANCE_CLASS);
322:                 initEAttribute(getCar_Manufacturer(), ecorePackage.getEString(),
323:                         "manufacturer", null, 0, 1, Car.class, !IS_TRANSIENT,
324:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
325:                         !IS_DERIVED, IS_ORDERED);
326:                 initEAttribute(getCar_LicensePlate(), ecorePackage.getEString(),
327:                         "licensePlate", null, 0, 1, Car.class, !IS_TRANSIENT,
328:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
329:                         !IS_DERIVED, IS_ORDERED);
330:                 initEAttribute(getCar_SeatCount(), ecorePackage.getEInt(), "seatCount",
331:                         null, 0, 1, Car.class, !IS_TRANSIENT, !IS_VOLATILE,
332:                         IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED,
333:                         IS_ORDERED);
334:                 initEReference(getCar_Driver(), this.getDriver(), null, "driver", null,
335:                         0, 1, Car.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
336:                         IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
337:                         !IS_DERIVED, IS_ORDERED);
338:
339:                 // Create resource
340:                 createResource(eNS_URI);
341:         }
342:
343: } // CarPackageImpl