Skip to content

Package: TestDataSwitch

TestDataSwitch

nameinstructionbranchcomplexitylinemethod
TestDataSwitch()
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%
caseTestData(TestData)
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: 21 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 7 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-2018 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 Muenchen GmbH - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.edit.internal.model.testData.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.edit.internal.model.testData.TestData;
20: import org.eclipse.emf.ecp.edit.internal.model.testData.TestDataPackage;
21:
22: /**
23: * <!-- begin-user-doc -->
24: * The <b>Switch</b> for the model's inheritance hierarchy.
25: * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
26: * to invoke the <code>caseXXX</code> method for each class of the model,
27: * starting with the actual class of the object
28: * and proceeding up the inheritance hierarchy
29: * until a non-null result is returned,
30: * which is the result of the switch.
31: * <!-- end-user-doc -->
32: *
33: * @see org.eclipse.emf.ecp.edit.internal.model.testData.TestDataPackage
34: * @generated
35: */
36: public class TestDataSwitch<T> extends Switch<T> {
37:         /**
38:          * The cached model package
39:          * <!-- begin-user-doc -->
40:          * <!-- end-user-doc -->
41:          *
42:          * @generated
43:          */
44:         protected static TestDataPackage modelPackage;
45:
46:         /**
47:          * Creates an instance of the switch.
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @generated
52:          */
53:         public TestDataSwitch() {
54:•                if (modelPackage == null) {
55:                         modelPackage = TestDataPackage.eINSTANCE;
56:                 }
57:         }
58:
59:         /**
60:          * Checks whether this is a switch for the given package.
61:          * <!-- begin-user-doc -->
62:          * <!-- end-user-doc -->
63:          *
64:          * @param ePackage the package in question.
65:          * @return whether this is a switch for the given package.
66:          * @generated
67:          */
68:         @Override
69:         protected boolean isSwitchFor(EPackage ePackage) {
70:•                return ePackage == modelPackage;
71:         }
72:
73:         /**
74:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
75:          * result.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @return the first non-null result returned by a <code>caseXXX</code> call.
80:          * @generated
81:          */
82:         @Override
83:         protected T doSwitch(int classifierID, EObject theEObject) {
84:•                switch (classifierID) {
85:                 case TestDataPackage.TEST_DATA: {
86:                         final TestData testData = (TestData) theEObject;
87:                         T result = caseTestData(testData);
88:•                        if (result == null) {
89:                                 result = defaultCase(theEObject);
90:                         }
91:                         return result;
92:                 }
93:                 default:
94:                         return defaultCase(theEObject);
95:                 }
96:         }
97:
98:         /**
99:          * Returns the result of interpreting the object as an instance of '<em>Test Data</em>'.
100:          * <!-- begin-user-doc -->
101:          * This implementation returns null;
102:          * returning a non-null result will terminate the switch.
103:          * <!-- end-user-doc -->
104:          *
105:          * @param object the target of the switch.
106:          * @return the result of interpreting the object as an instance of '<em>Test Data</em>'.
107:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
108:          * @generated
109:          */
110:         public T caseTestData(TestData object) {
111:                 return null;
112:         }
113:
114:         /**
115:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
116:          * <!-- begin-user-doc -->
117:          * This implementation returns null;
118:          * returning a non-null result will terminate the switch, but this is the last case anyway.
119:          * <!-- end-user-doc -->
120:          *
121:          * @param object the target of the switch.
122:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
123:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
124:          * @generated
125:          */
126:         @Override
127:         public T defaultCase(EObject object) {
128:                 return null;
129:         }
130:
131: } // TestDataSwitch