Skip to content

Package: TabSwitch

TabSwitch

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