Skip to content

Package: KeybindingSwitch

KeybindingSwitch

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