Skip to content

Package: CarAdapterFactory$1

CarAdapterFactory$1

nameinstructionbranchcomplexitylinemethod
caseCar(Car)
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%
caseDriver(Driver)
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%
casePerson(Person)
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%
defaultCase(EObject)
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%
{...}
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: */
3: package car.util;
4:
5: import org.eclipse.emf.common.notify.Adapter;
6: import org.eclipse.emf.common.notify.Notifier;
7: import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
8: import org.eclipse.emf.ecore.EObject;
9:
10: import car.Car;
11: import car.CarPackage;
12: import car.Driver;
13: import car.Person;
14:
15: /**
16: * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides
17: * an adapter <code>createXXX</code> method for each class of the model. <!--
18: * end-user-doc -->
19: *
20: * @see car.CarPackage
21: * @generated
22: */
23: public class CarAdapterFactory extends AdapterFactoryImpl {
24:         /**
25:          * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
26:          *
27:          * @generated
28:          */
29:         protected static CarPackage modelPackage;
30:
31:         /**
32:          * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!--
33:          * end-user-doc -->
34:          *
35:          * @generated
36:          */
37:         public CarAdapterFactory() {
38:                 if (modelPackage == null) {
39:                         modelPackage = CarPackage.eINSTANCE;
40:                 }
41:         }
42:
43:         /**
44:          * Returns whether this factory is applicable for the type of the object.
45:          * <!-- begin-user-doc --> This implementation returns <code>true</code> if
46:          * the object is either the model's package or is an instance object of the
47:          * model. <!-- end-user-doc -->
48:          *
49:          * @return whether this factory is applicable for the type of the object.
50:          * @generated
51:          */
52:         @Override
53:         public boolean isFactoryForType(Object object) {
54:                 if (object == modelPackage) {
55:                         return true;
56:                 }
57:                 if (object instanceof EObject) {
58:                         return ((EObject) object).eClass().getEPackage() == modelPackage;
59:                 }
60:                 return false;
61:         }
62:
63:         /**
64:          * The switch that delegates to the <code>createXXX</code> methods. <!--
65:          * begin-user-doc --> <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         protected CarSwitch<Adapter> modelSwitch = new CarSwitch<Adapter>() {
70:                 @Override
71:                 public Adapter casePerson(Person object) {
72:                         return createPersonAdapter();
73:                 }
74:
75:                 @Override
76:                 public Adapter caseDriver(Driver object) {
77:                         return createDriverAdapter();
78:                 }
79:
80:                 @Override
81:                 public Adapter caseCar(Car object) {
82:                         return createCarAdapter();
83:                 }
84:
85:                 @Override
86:                 public Adapter defaultCase(EObject object) {
87:                         return createEObjectAdapter();
88:                 }
89:         };
90:
91:         /**
92:          * Creates an adapter for the <code>target</code>. <!-- begin-user-doc -->
93:          * <!-- end-user-doc -->
94:          *
95:          * @param target
96:          * the object to adapt.
97:          * @return the adapter for the <code>target</code>.
98:          * @generated
99:          */
100:         @Override
101:         public Adapter createAdapter(Notifier target) {
102:                 return modelSwitch.doSwitch((EObject) target);
103:         }
104:
105:         /**
106:          * Creates a new adapter for an object of class '{@link car.Person
107:          * <em>Person</em>}'. <!-- begin-user-doc --> This default implementation
108:          * returns null so that we can easily ignore cases; it's useful to ignore a
109:          * case when inheritance will catch all the cases anyway. <!-- end-user-doc
110:          * -->
111:          *
112:          * @return the new adapter.
113:          * @see car.Person
114:          * @generated
115:          */
116:         public Adapter createPersonAdapter() {
117:                 return null;
118:         }
119:
120:         /**
121:          * Creates a new adapter for an object of class '{@link car.Driver
122:          * <em>Driver</em>}'. <!-- begin-user-doc --> This default implementation
123:          * returns null so that we can easily ignore cases; it's useful to ignore a
124:          * case when inheritance will catch all the cases anyway. <!-- end-user-doc
125:          * -->
126:          *
127:          * @return the new adapter.
128:          * @see car.Driver
129:          * @generated
130:          */
131:         public Adapter createDriverAdapter() {
132:                 return null;
133:         }
134:
135:         /**
136:          * Creates a new adapter for an object of class '{@link car.Car
137:          * <em>Car</em>}'. <!-- begin-user-doc --> This default implementation
138:          * returns null so that we can easily ignore cases; it's useful to ignore a
139:          * case when inheritance will catch all the cases anyway. <!-- end-user-doc
140:          * -->
141:          *
142:          * @return the new adapter.
143:          * @see car.Car
144:          * @generated
145:          */
146:         public Adapter createCarAdapter() {
147:                 return null;
148:         }
149:
150:         /**
151:          * Creates a new adapter for the default case. <!-- begin-user-doc --> This
152:          * default implementation returns null. <!-- end-user-doc -->
153:          *
154:          * @return the new adapter.
155:          * @generated
156:          */
157:         public Adapter createEObjectAdapter() {
158:                 return null;
159:         }
160:
161: } // CarAdapterFactory