Skip to content

Package: ModelSwitch

ModelSwitch

nameinstructionbranchcomplexitylinemethod
ModelSwitch()
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: 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%
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%
caseDomainIntermediate(DomainIntermediate)
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%
caseDomainModelReference(VDomainModelReference)
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%
caseDomainRoot(DomainRoot)
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%
caseDynamicContainmentItem(DynamicContainmentItem)
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%
caseDynamicContainmentTree(DynamicContainmentTree)
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%
caseDynamicContainmentTreeDomainModelReference(DynamicContainmentTreeDomainModelReference)
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%
caseTestElement(TestElement)
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%
caseTestElementContainer(TestElementContainer)
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: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
doSwitch(int, EObject)
M: 95 C: 58
38%
M: 22 C: 14
39%
M: 18 C: 4
18%
M: 28 C: 23
45%
M: 0 C: 1
100%
isSwitchFor(EPackage)
M: 2 C: 5
71%
M: 1 C: 1
50%
M: 1 C: 1
50%
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: * Edgar Mueller - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.dynamictree.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.dynamictree.model.DomainIntermediate;
20: import org.eclipse.emf.ecp.view.dynamictree.model.DomainRoot;
21: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentItem;
22: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTree;
23: import org.eclipse.emf.ecp.view.dynamictree.model.DynamicContainmentTreeDomainModelReference;
24: import org.eclipse.emf.ecp.view.dynamictree.model.ModelPackage;
25: import org.eclipse.emf.ecp.view.dynamictree.model.TestElement;
26: import org.eclipse.emf.ecp.view.dynamictree.model.TestElementContainer;
27: import org.eclipse.emf.ecp.view.spi.categorization.model.VAbstractCategorization;
28: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategorizableElement;
29: import org.eclipse.emf.ecp.view.spi.categorization.model.VCategory;
30: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
31: import org.eclipse.emf.ecp.view.spi.model.VElement;
32:
33: /**
34: * <!-- begin-user-doc -->
35: * The <b>Switch</b> for the model's inheritance hierarchy.
36: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
37: * class of the model,
38: * starting with the actual class of the object
39: * and proceeding up the inheritance hierarchy
40: * until a non-null result is returned,
41: * which is the result of the switch.
42: * <!-- end-user-doc -->
43: *
44: * @see org.eclipse.emf.ecp.view.dynamictree.model.ModelPackage
45: * @generated
46: */
47: public class ModelSwitch<T> extends Switch<T> {
48:         /**
49:          * The cached model package
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         protected static ModelPackage modelPackage;
56:
57:         /**
58:          * Creates an instance of the switch.
59:          * <!-- begin-user-doc -->
60:          * <!-- end-user-doc -->
61:          *
62:          * @generated
63:          */
64:         public ModelSwitch() {
65:•                if (modelPackage == null) {
66:                         modelPackage = ModelPackage.eINSTANCE;
67:                 }
68:         }
69:
70:         /**
71:          * Checks whether this is a switch for the given package.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @parameter ePackage the package in question.
76:          * @return whether this is a switch for the given package.
77:          * @generated
78:          */
79:         @Override
80:         protected boolean isSwitchFor(EPackage ePackage) {
81:•                return ePackage == modelPackage;
82:         }
83:
84:         /**
85:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
86:          * result.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @return the first non-null result returned by a <code>caseXXX</code> call.
91:          * @generated
92:          */
93:         @Override
94:         protected T doSwitch(int classifierID, EObject theEObject) {
95:•                switch (classifierID) {
96:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE: {
97:                         final DynamicContainmentTree dynamicContainmentTree = (DynamicContainmentTree) theEObject;
98:                         T result = caseDynamicContainmentTree(dynamicContainmentTree);
99:•                        if (result == null) {
100:                                 result = caseCategory(dynamicContainmentTree);
101:                         }
102:•                        if (result == null) {
103:                                 result = caseAbstractCategorization(dynamicContainmentTree);
104:                         }
105:•                        if (result == null) {
106:                                 result = caseCategorizableElement(dynamicContainmentTree);
107:                         }
108:•                        if (result == null) {
109:                                 result = caseElement(dynamicContainmentTree);
110:                         }
111:•                        if (result == null) {
112:                                 result = defaultCase(theEObject);
113:                         }
114:                         return result;
115:                 }
116:                 case ModelPackage.DYNAMIC_CONTAINMENT_ITEM: {
117:                         final DynamicContainmentItem dynamicContainmentItem = (DynamicContainmentItem) theEObject;
118:                         T result = caseDynamicContainmentItem(dynamicContainmentItem);
119:•                        if (result == null) {
120:                                 result = caseCategorizableElement(dynamicContainmentItem);
121:                         }
122:•                        if (result == null) {
123:                                 result = caseElement(dynamicContainmentItem);
124:                         }
125:•                        if (result == null) {
126:                                 result = defaultCase(theEObject);
127:                         }
128:                         return result;
129:                 }
130:                 case ModelPackage.TEST_ELEMENT: {
131:                         final TestElement testElement = (TestElement) theEObject;
132:                         T result = caseTestElement(testElement);
133:•                        if (result == null) {
134:                                 result = defaultCase(theEObject);
135:                         }
136:                         return result;
137:                 }
138:                 case ModelPackage.DOMAIN_ROOT: {
139:                         final DomainRoot domainRoot = (DomainRoot) theEObject;
140:                         T result = caseDomainRoot(domainRoot);
141:•                        if (result == null) {
142:                                 result = defaultCase(theEObject);
143:                         }
144:                         return result;
145:                 }
146:                 case ModelPackage.DOMAIN_INTERMEDIATE: {
147:                         final DomainIntermediate domainIntermediate = (DomainIntermediate) theEObject;
148:                         T result = caseDomainIntermediate(domainIntermediate);
149:•                        if (result == null) {
150:                                 result = defaultCase(theEObject);
151:                         }
152:                         return result;
153:                 }
154:                 case ModelPackage.TEST_ELEMENT_CONTAINER: {
155:                         final TestElementContainer testElementContainer = (TestElementContainer) theEObject;
156:                         T result = caseTestElementContainer(testElementContainer);
157:•                        if (result == null) {
158:                                 result = defaultCase(theEObject);
159:                         }
160:                         return result;
161:                 }
162:                 case ModelPackage.DYNAMIC_CONTAINMENT_TREE_DOMAIN_MODEL_REFERENCE: {
163:                         final DynamicContainmentTreeDomainModelReference dynamicContainmentTreeDomainModelReference = (DynamicContainmentTreeDomainModelReference) theEObject;
164:                         T result = caseDynamicContainmentTreeDomainModelReference(dynamicContainmentTreeDomainModelReference);
165:•                        if (result == null) {
166:                                 result = caseDomainModelReference(dynamicContainmentTreeDomainModelReference);
167:                         }
168:•                        if (result == null) {
169:                                 result = defaultCase(theEObject);
170:                         }
171:                         return result;
172:                 }
173:                 default:
174:                         return defaultCase(theEObject);
175:                 }
176:         }
177:
178:         /**
179:          * Returns the result of interpreting the object as an instance of '<em>Dynamic Containment Tree</em>'.
180:          * <!-- begin-user-doc -->
181:          * This implementation returns null;
182:          * returning a non-null result will terminate the switch.
183:          * <!-- end-user-doc -->
184:          *
185:          * @param object the target of the switch.
186:          * @return the result of interpreting the object as an instance of '<em>Dynamic Containment Tree</em>'.
187:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
188:          * @generated
189:          */
190:         public T caseDynamicContainmentTree(DynamicContainmentTree object) {
191:                 return null;
192:         }
193:
194:         /**
195:          * Returns the result of interpreting the object as an instance of '<em>Dynamic Containment Item</em>'.
196:          * <!-- begin-user-doc -->
197:          * This implementation returns null;
198:          * returning a non-null result will terminate the switch.
199:          * <!-- end-user-doc -->
200:          *
201:          * @param object the target of the switch.
202:          * @return the result of interpreting the object as an instance of '<em>Dynamic Containment Item</em>'.
203:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
204:          * @generated
205:          */
206:         public T caseDynamicContainmentItem(DynamicContainmentItem object) {
207:                 return null;
208:         }
209:
210:         /**
211:          * Returns the result of interpreting the object as an instance of '<em>Test Element</em>'.
212:          * <!-- begin-user-doc -->
213:          * This implementation returns null;
214:          * returning a non-null result will terminate the switch.
215:          * <!-- end-user-doc -->
216:          *
217:          * @param object the target of the switch.
218:          * @return the result of interpreting the object as an instance of '<em>Test Element</em>'.
219:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
220:          * @generated
221:          */
222:         public T caseTestElement(TestElement object) {
223:                 return null;
224:         }
225:
226:         /**
227:          * Returns the result of interpreting the object as an instance of '<em>Domain Root</em>'.
228:          * <!-- begin-user-doc -->
229:          * This implementation returns null;
230:          * returning a non-null result will terminate the switch.
231:          * <!-- end-user-doc -->
232:          *
233:          * @param object the target of the switch.
234:          * @return the result of interpreting the object as an instance of '<em>Domain Root</em>'.
235:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
236:          * @generated
237:          */
238:         public T caseDomainRoot(DomainRoot object) {
239:                 return null;
240:         }
241:
242:         /**
243:          * Returns the result of interpreting the object as an instance of '<em>Domain Intermediate</em>'.
244:          * <!-- begin-user-doc -->
245:          * This implementation returns null;
246:          * returning a non-null result will terminate the switch.
247:          * <!-- end-user-doc -->
248:          *
249:          * @param object the target of the switch.
250:          * @return the result of interpreting the object as an instance of '<em>Domain Intermediate</em>'.
251:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
252:          * @generated
253:          */
254:         public T caseDomainIntermediate(DomainIntermediate object) {
255:                 return null;
256:         }
257:
258:         /**
259:          * Returns the result of interpreting the object as an instance of '<em>Test Element Container</em>'.
260:          * <!-- begin-user-doc -->
261:          * This implementation returns null;
262:          * returning a non-null result will terminate the switch.
263:          * <!-- end-user-doc -->
264:          *
265:          * @param object the target of the switch.
266:          * @return the result of interpreting the object as an instance of '<em>Test Element Container</em>'.
267:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
268:          * @generated
269:          */
270:         public T caseTestElementContainer(TestElementContainer object) {
271:                 return null;
272:         }
273:
274:         /**
275:          * Returns the result of interpreting the object as an instance of '
276:          * <em>Dynamic Containment Tree Domain Model Reference</em>'.
277:          * <!-- begin-user-doc -->
278:          * This implementation returns null;
279:          * returning a non-null result will terminate the switch.
280:          * <!-- end-user-doc -->
281:          *
282:          * @param object the target of the switch.
283:          * @return the result of interpreting the object as an instance of '
284:          * <em>Dynamic Containment Tree Domain Model Reference</em>'.
285:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
286:          * @generated
287:          */
288:         public T caseDynamicContainmentTreeDomainModelReference(DynamicContainmentTreeDomainModelReference object) {
289:                 return null;
290:         }
291:
292:         /**
293:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
294:          * <!-- begin-user-doc -->
295:          * This implementation returns null;
296:          * returning a non-null result will terminate the switch.
297:          * <!-- end-user-doc -->
298:          *
299:          * @param object the target of the switch.
300:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
301:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
302:          * @generated
303:          */
304:         public T caseElement(VElement object) {
305:                 return null;
306:         }
307:
308:         /**
309:          * Returns the result of interpreting the object as an instance of '<em>Categorizable Element</em>'.
310:          * <!-- begin-user-doc -->
311:          * This implementation returns null;
312:          * returning a non-null result will terminate the switch.
313:          * <!-- end-user-doc -->
314:          *
315:          * @param object the target of the switch.
316:          * @return the result of interpreting the object as an instance of '<em>Categorizable Element</em>'.
317:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
318:          * @generated
319:          */
320:         public T caseCategorizableElement(VCategorizableElement object) {
321:                 return null;
322:         }
323:
324:         /**
325:          * Returns the result of interpreting the object as an instance of '<em>Abstract Categorization</em>'.
326:          * <!-- begin-user-doc -->
327:          * This implementation returns null;
328:          * returning a non-null result will terminate the switch.
329:          * <!-- end-user-doc -->
330:          *
331:          * @param object the target of the switch.
332:          * @return the result of interpreting the object as an instance of '<em>Abstract Categorization</em>'.
333:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
334:          * @generated
335:          */
336:         public T caseAbstractCategorization(VAbstractCategorization object) {
337:                 return null;
338:         }
339:
340:         /**
341:          * Returns the result of interpreting the object as an instance of '<em>Category</em>'.
342:          * <!-- begin-user-doc -->
343:          * This implementation returns null;
344:          * returning a non-null result will terminate the switch.
345:          * <!-- end-user-doc -->
346:          *
347:          * @param object the target of the switch.
348:          * @return the result of interpreting the object as an instance of '<em>Category</em>'.
349:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
350:          * @generated
351:          */
352:         public T caseCategory(VCategory object) {
353:                 return null;
354:         }
355:
356:         /**
357:          * Returns the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
358:          * <!-- begin-user-doc -->
359:          * This implementation returns null;
360:          * returning a non-null result will terminate the switch.
361:          * <!-- end-user-doc -->
362:          *
363:          * @param object the target of the switch.
364:          * @return the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
365:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
366:          * @generated
367:          */
368:         public T caseDomainModelReference(VDomainModelReference object) {
369:                 return null;
370:         }
371:
372:         /**
373:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
374:          * <!-- begin-user-doc -->
375:          * This implementation returns null;
376:          * returning a non-null result will terminate the switch, but this is the last case anyway.
377:          * <!-- end-user-doc -->
378:          *
379:          * @param object the target of the switch.
380:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
381:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
382:          * @generated
383:          */
384:         @Override
385:         public T defaultCase(EObject object) {
386:                 return null;
387:         }
388:
389: } // ModelSwitch