Skip to content

Package: TestTMDSwitch

TestTMDSwitch

nameinstructionbranchcomplexitylinemethod
TestTMDSwitch()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
caseChildLevel1(ChildLevel1)
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%
caseChildLevel2(ChildLevel2)
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%
caseRoot(Root)
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: 51 C: 0
0%
M: 10 C: 0
0%
M: 7 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%
isSwitchFor(EPackage)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.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.treemasterdetail.validation.test.TestTMD.ChildLevel1;
20: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2;
21: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.Root;
22: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage;
23:
24: /**
25: * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance
26: * hierarchy. It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method
27: * for each class of the model,
28: * starting with the actual class of the object and proceeding up the
29: * inheritance hierarchy until a non-null result is returned, which is the
30: * result of the switch. <!-- end-user-doc -->
31: *
32: * @see org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage
33: * @generated
34: */
35: public class TestTMDSwitch<T> extends Switch<T> {
36:         /**
37:          * The cached model package <!-- begin-user-doc --> <!-- end-user-doc -->
38:          *
39:          * @generated
40:          */
41:         protected static TestTMDPackage modelPackage;
42:
43:         /**
44:          * Creates an instance of the switch. <!-- begin-user-doc --> <!--
45:          * end-user-doc -->
46:          *
47:          * @generated
48:          */
49:         public TestTMDSwitch() {
50:•                if (modelPackage == null) {
51:                         modelPackage = TestTMDPackage.eINSTANCE;
52:                 }
53:         }
54:
55:         /**
56:          * Checks whether this is a switch for the given package. <!--
57:          * begin-user-doc --> <!-- end-user-doc -->
58:          *
59:          * @parameter ePackage the package in question.
60:          * @return whether this is a switch for the given package.
61:          * @generated
62:          */
63:         @Override
64:         protected boolean isSwitchFor(EPackage ePackage) {
65:•                return ePackage == modelPackage;
66:         }
67:
68:         /**
69:          * Calls <code>caseXXX</code> for each class of the model until one returns
70:          * a non null result; it yields that result. <!-- begin-user-doc --> <!--
71:          * end-user-doc -->
72:          *
73:          * @return the first non-null result returned by a <code>caseXXX</code> call.
74:          * @generated
75:          */
76:         @Override
77:         protected T doSwitch(int classifierID, EObject theEObject) {
78:•                switch (classifierID) {
79:                 case TestTMDPackage.ROOT: {
80:                         final Root root = (Root) theEObject;
81:                         T result = caseRoot(root);
82:•                        if (result == null) {
83:                                 result = defaultCase(theEObject);
84:                         }
85:                         return result;
86:                 }
87:                 case TestTMDPackage.CHILD_LEVEL1: {
88:                         final ChildLevel1 childLevel1 = (ChildLevel1) theEObject;
89:                         T result = caseChildLevel1(childLevel1);
90:•                        if (result == null) {
91:                                 result = defaultCase(theEObject);
92:                         }
93:                         return result;
94:                 }
95:                 case TestTMDPackage.CHILD_LEVEL2: {
96:                         final ChildLevel2 childLevel2 = (ChildLevel2) theEObject;
97:                         T result = caseChildLevel2(childLevel2);
98:•                        if (result == null) {
99:                                 result = defaultCase(theEObject);
100:                         }
101:                         return result;
102:                 }
103:                 default:
104:                         return defaultCase(theEObject);
105:                 }
106:         }
107:
108:         /**
109:          * Returns the result of interpreting the object as an instance of ' <em>Root</em>'. <!-- begin-user-doc --> This
110:          * implementation returns null;
111:          * returning a non-null result will terminate the switch. <!-- end-user-doc
112:          * -->
113:          *
114:          * @param object
115:          * the target of the switch.
116:          * @return the result of interpreting the object as an instance of ' <em>Root</em>'.
117:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
118:          * @generated
119:          */
120:         public T caseRoot(Root object) {
121:                 return null;
122:         }
123:
124:         /**
125:          * Returns the result of interpreting the object as an instance of ' <em>Child Level1</em>'. <!-- begin-user-doc -->
126:          * This implementation
127:          * returns null; returning a non-null result will terminate the switch. <!--
128:          * end-user-doc -->
129:          *
130:          * @param object
131:          * the target of the switch.
132:          * @return the result of interpreting the object as an instance of ' <em>Child Level1</em>'.
133:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
134:          * @generated
135:          */
136:         public T caseChildLevel1(ChildLevel1 object) {
137:                 return null;
138:         }
139:
140:         /**
141:          * Returns the result of interpreting the object as an instance of ' <em>Child Level2</em>'. <!-- begin-user-doc -->
142:          * This implementation
143:          * returns null; returning a non-null result will terminate the switch. <!--
144:          * end-user-doc -->
145:          *
146:          * @param object
147:          * the target of the switch.
148:          * @return the result of interpreting the object as an instance of ' <em>Child Level2</em>'.
149:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
150:          * @generated
151:          */
152:         public T caseChildLevel2(ChildLevel2 object) {
153:                 return null;
154:         }
155:
156:         /**
157:          * Returns the result of interpreting the object as an instance of ' <em>EObject</em>'. <!-- begin-user-doc --> This
158:          * implementation returns
159:          * null; returning a non-null result will terminate the switch, but this is
160:          * the last case anyway. <!-- end-user-doc -->
161:          *
162:          * @param object
163:          * the target of the switch.
164:          * @return the result of interpreting the object as an instance of ' <em>EObject</em>'.
165:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
166:          * @generated
167:          */
168:         @Override
169:         public T defaultCase(EObject object) {
170:                 return null;
171:         }
172:
173: } // TestTMDSwitch