Skip to content

Package: ZSwitch

ZSwitch

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