Skip to content

Package: CategorizationSwitch

CategorizationSwitch

nameinstructionbranchcomplexitylinemethod
CategorizationSwitch()
M: 0 C: 7
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
caseAbstractCategorization(VAbstractCategorization)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseAction(VAction)
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%
caseCategorizableElement(VCategorizableElement)
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%
caseCategorization(VCategorization)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseCategorizationElement(VCategorizationElement)
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%
caseCategory(VCategory)
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%
caseContainedElement(VContainedElement)
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%
caseElement(VElement)
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%
caseHasTooltip(VHasTooltip)
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%
defaultCase(EObject)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
doSwitch(int, EObject)
M: 112 C: 74
40%
M: 29 C: 20
41%
M: 22 C: 6
21%
M: 33 C: 29
47%
M: 0 C: 1
100%
isSwitchFor(EPackage)
M: 0 C: 7
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2013 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.emf.ecp.view.spi.categorization.model.util;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.util.Switch;
19: import org.eclipse.emf.ecp.view.spi.categorization.model.VAbstractCategorization;
20: import org.eclipse.emf.ecp.view.spi.categorization.model.VAction;
21: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategorizableElement;
22: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategorization;
23: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategorizationElement;
24: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategorizationPackage;
25: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategory;
26: import org.eclipse.emf.ecp.view.spi.model.VContainedElement;
27: import org.eclipse.emf.ecp.view.spi.model.VElement;
28: import org.eclipse.emf.ecp.view.spi.model.VHasTooltip;
29:
30: /**
31: * <!-- begin-user-doc -->
32: * The <b>Switch</b> for the model's inheritance hierarchy.
33: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
34: * class of the model,
35: * starting with the actual class of the object
36: * and proceeding up the inheritance hierarchy
37: * until a non-null result is returned,
38: * which is the result of the switch.
39: * <!-- end-user-doc -->
40: *
41: * @see org.eclipse.emf.ecp.view.spi.categorization.model.VCategorizationPackage
42: * @generated
43: */
44: public class CategorizationSwitch<T> extends Switch<T> {
45:         /**
46:          * The cached model package
47:          * <!-- begin-user-doc -->
48:          * <!-- end-user-doc -->
49:          *
50:          * @generated
51:          */
52:         protected static VCategorizationPackage modelPackage;
53:
54:         /**
55:          * Creates an instance of the switch.
56:          * <!-- begin-user-doc -->
57:          * <!-- end-user-doc -->
58:          *
59:          * @generated
60:          */
61:         public CategorizationSwitch() {
62:•                if (modelPackage == null) {
63:                         modelPackage = VCategorizationPackage.eINSTANCE;
64:                 }
65:         }
66:
67:         /**
68:          * Checks whether this is a switch for the given package.
69:          * <!-- begin-user-doc -->
70:          * <!-- end-user-doc -->
71:          *
72:          * @param ePackage the package in question.
73:          * @return whether this is a switch for the given package.
74:          * @generated
75:          */
76:         @Override
77:         protected boolean isSwitchFor(EPackage ePackage) {
78:•                return ePackage == modelPackage;
79:         }
80:
81:         /**
82:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
83:          * result.
84:          * <!-- begin-user-doc -->
85:          * <!-- end-user-doc -->
86:          *
87:          * @return the first non-null result returned by a <code>caseXXX</code> call.
88:          * @generated
89:          */
90:         @Override
91:         protected T doSwitch(int classifierID, EObject theEObject) {
92:•                switch (classifierID) {
93:                 case VCategorizationPackage.ABSTRACT_CATEGORIZATION: {
94:                         final VAbstractCategorization abstractCategorization = (VAbstractCategorization) theEObject;
95:                         T result = caseAbstractCategorization(abstractCategorization);
96:•                        if (result == null) {
97:                                 result = caseCategorizableElement(abstractCategorization);
98:                         }
99:•                        if (result == null) {
100:                                 result = caseElement(abstractCategorization);
101:                         }
102:•                        if (result == null) {
103:                                 result = caseHasTooltip(abstractCategorization);
104:                         }
105:•                        if (result == null) {
106:                                 result = defaultCase(theEObject);
107:                         }
108:                         return result;
109:                 }
110:                 case VCategorizationPackage.CATEGORIZATION: {
111:                         final VCategorization categorization = (VCategorization) theEObject;
112:                         T result = caseCategorization(categorization);
113:•                        if (result == null) {
114:                                 result = caseAbstractCategorization(categorization);
115:                         }
116:•                        if (result == null) {
117:                                 result = caseCategorizableElement(categorization);
118:                         }
119:•                        if (result == null) {
120:                                 result = caseElement(categorization);
121:                         }
122:•                        if (result == null) {
123:                                 result = caseHasTooltip(categorization);
124:                         }
125:•                        if (result == null) {
126:                                 result = defaultCase(theEObject);
127:                         }
128:                         return result;
129:                 }
130:                 case VCategorizationPackage.CATEGORY: {
131:                         final VCategory category = (VCategory) theEObject;
132:                         T result = caseCategory(category);
133:•                        if (result == null) {
134:                                 result = caseAbstractCategorization(category);
135:                         }
136:•                        if (result == null) {
137:                                 result = caseCategorizableElement(category);
138:                         }
139:•                        if (result == null) {
140:                                 result = caseElement(category);
141:                         }
142:•                        if (result == null) {
143:                                 result = caseHasTooltip(category);
144:                         }
145:•                        if (result == null) {
146:                                 result = defaultCase(theEObject);
147:                         }
148:                         return result;
149:                 }
150:                 case VCategorizationPackage.ACTION: {
151:                         final VAction action = (VAction) theEObject;
152:                         T result = caseAction(action);
153:•                        if (result == null) {
154:                                 result = defaultCase(theEObject);
155:                         }
156:                         return result;
157:                 }
158:                 case VCategorizationPackage.CATEGORIZATION_ELEMENT: {
159:                         final VCategorizationElement categorizationElement = (VCategorizationElement) theEObject;
160:                         T result = caseCategorizationElement(categorizationElement);
161:•                        if (result == null) {
162:                                 result = caseContainedElement(categorizationElement);
163:                         }
164:•                        if (result == null) {
165:                                 result = caseElement(categorizationElement);
166:                         }
167:•                        if (result == null) {
168:                                 result = defaultCase(theEObject);
169:                         }
170:                         return result;
171:                 }
172:                 case VCategorizationPackage.CATEGORIZABLE_ELEMENT: {
173:                         final VCategorizableElement categorizableElement = (VCategorizableElement) theEObject;
174:                         T result = caseCategorizableElement(categorizableElement);
175:•                        if (result == null) {
176:                                 result = caseElement(categorizableElement);
177:                         }
178:•                        if (result == null) {
179:                                 result = caseHasTooltip(categorizableElement);
180:                         }
181:•                        if (result == null) {
182:                                 result = defaultCase(theEObject);
183:                         }
184:                         return result;
185:                 }
186:                 default:
187:                         return defaultCase(theEObject);
188:                 }
189:         }
190:
191:         /**
192:          * Returns the result of interpreting the object as an instance of '<em>Abstract Categorization</em>'.
193:          * <!-- begin-user-doc -->
194:          * This implementation returns null;
195:          * returning a non-null result will terminate the switch.
196:          * <!-- end-user-doc -->
197:          *
198:          * @param object the target of the switch.
199:          * @return the result of interpreting the object as an instance of '<em>Abstract Categorization</em>'.
200:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
201:          * @generated
202:          */
203:         public T caseAbstractCategorization(VAbstractCategorization object) {
204:                 return null;
205:         }
206:
207:         /**
208:          * Returns the result of interpreting the object as an instance of '<em>Categorization</em>'.
209:          * <!-- begin-user-doc -->
210:          * This implementation returns null;
211:          * returning a non-null result will terminate the switch.
212:          * <!-- end-user-doc -->
213:          *
214:          * @param object the target of the switch.
215:          * @return the result of interpreting the object as an instance of '<em>Categorization</em>'.
216:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
217:          * @generated
218:          */
219:         public T caseCategorization(VCategorization object) {
220:                 return null;
221:         }
222:
223:         /**
224:          * Returns the result of interpreting the object as an instance of '<em>Category</em>'.
225:          * <!-- begin-user-doc -->
226:          * This implementation returns null;
227:          * returning a non-null result will terminate the switch.
228:          * <!-- end-user-doc -->
229:          *
230:          * @param object the target of the switch.
231:          * @return the result of interpreting the object as an instance of '<em>Category</em>'.
232:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
233:          * @generated
234:          */
235:         public T caseCategory(VCategory object) {
236:                 return null;
237:         }
238:
239:         /**
240:          * Returns the result of interpreting the object as an instance of '<em>Action</em>'.
241:          * <!-- begin-user-doc -->
242:          * This implementation returns null;
243:          * returning a non-null result will terminate the switch.
244:          * <!-- end-user-doc -->
245:          *
246:          * @param object the target of the switch.
247:          * @return the result of interpreting the object as an instance of '<em>Action</em>'.
248:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
249:          * @generated
250:          */
251:         public T caseAction(VAction object) {
252:                 return null;
253:         }
254:
255:         /**
256:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
257:          * <!-- begin-user-doc -->
258:          * This implementation returns null;
259:          * returning a non-null result will terminate the switch.
260:          * <!-- end-user-doc -->
261:          *
262:          * @param object the target of the switch.
263:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
264:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
265:          * @generated
266:          */
267:         public T caseCategorizationElement(VCategorizationElement object) {
268:                 return null;
269:         }
270:
271:         /**
272:          * Returns the result of interpreting the object as an instance of '<em>Categorizable Element</em>'.
273:          * <!-- begin-user-doc -->
274:          * This implementation returns null;
275:          * returning a non-null result will terminate the switch.
276:          * <!-- end-user-doc -->
277:          *
278:          * @param object the target of the switch.
279:          * @return the result of interpreting the object as an instance of '<em>Categorizable Element</em>'.
280:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
281:          * @generated
282:          */
283:         public T caseCategorizableElement(VCategorizableElement object) {
284:                 return null;
285:         }
286:
287:         /**
288:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
289:          * <!-- begin-user-doc -->
290:          * This implementation returns null;
291:          * returning a non-null result will terminate the switch.
292:          * <!-- end-user-doc -->
293:          *
294:          * @param object the target of the switch.
295:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
296:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
297:          * @generated
298:          */
299:         public T caseElement(VElement object) {
300:                 return null;
301:         }
302:
303:         /**
304:          * Returns the result of interpreting the object as an instance of '<em>Has Tooltip</em>'.
305:          * <!-- begin-user-doc -->
306:          * This implementation returns null;
307:          * returning a non-null result will terminate the switch.
308:          * <!-- end-user-doc -->
309:          *
310:          * @param object the target of the switch.
311:          * @return the result of interpreting the object as an instance of '<em>Has Tooltip</em>'.
312:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
313:          * @generated
314:          * @since 1.13
315:          */
316:         public T caseHasTooltip(VHasTooltip object) {
317:                 return null;
318:         }
319:
320:         /**
321:          * Returns the result of interpreting the object as an instance of '<em>Contained Element</em>'.
322:          * <!-- begin-user-doc -->
323:          * This implementation returns null;
324:          * returning a non-null result will terminate the switch.
325:          * <!-- end-user-doc -->
326:          *
327:          * @param object the target of the switch.
328:          * @return the result of interpreting the object as an instance of '<em>Contained Element</em>'.
329:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
330:          * @generated
331:          */
332:         public T caseContainedElement(VContainedElement object) {
333:                 return null;
334:         }
335:
336:         /**
337:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
338:          * <!-- begin-user-doc -->
339:          * This implementation returns null;
340:          * returning a non-null result will terminate the switch, but this is the last case anyway.
341:          * <!-- end-user-doc -->
342:          *
343:          * @param object the target of the switch.
344:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
345:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
346:          * @generated
347:          */
348:         @Override
349:         public T defaultCase(EObject object) {
350:                 return null;
351:         }
352:
353: } // CategorizationSwitch