Skip to content

Package: BackgroundSwitch

BackgroundSwitch

nameinstructionbranchcomplexitylinemethod
BackgroundSwitch()
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%
caseBackgroundStyleProperty(VTBackgroundStyleProperty)
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: 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-2015 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.background.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.background.model.VTBackgroundPackage;
21: import org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundStyleProperty;
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)} to invoke the <code>caseXXX</code> method for each
27: * 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.5
34: * <!-- end-user-doc -->
35: *
36: * @see org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundPackage
37: * @generated
38: */
39: public class BackgroundSwitch<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 VTBackgroundPackage modelPackage;
48:
49:         /**
50:          * Creates an instance of the switch.
51:          * <!-- begin-user-doc -->
52:          * <!-- end-user-doc -->
53:          *
54:          * @generated
55:          */
56:         public BackgroundSwitch() {
57:•                if (modelPackage == null) {
58:                         modelPackage = VTBackgroundPackage.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:          * @parameter 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 VTBackgroundPackage.BACKGROUND_STYLE_PROPERTY: {
89:                         final VTBackgroundStyleProperty backgroundStyleProperty = (VTBackgroundStyleProperty) theEObject;
90:                         T result = caseBackgroundStyleProperty(backgroundStyleProperty);
91:•                        if (result == null) {
92:                                 result = caseStyleProperty(backgroundStyleProperty);
93:                         }
94:•                        if (result == null) {
95:                                 result = defaultCase(theEObject);
96:                         }
97:                         return result;
98:                 }
99:                 default:
100:                         return defaultCase(theEObject);
101:                 }
102:         }
103:
104:         /**
105:          * Returns the result of interpreting the object as an instance of '<em>Style Property</em>'.
106:          * <!-- begin-user-doc -->
107:          * This implementation returns null;
108:          * returning a non-null result will terminate the switch.
109:          * <!-- end-user-doc -->
110:          *
111:          * @param object the target of the switch.
112:          * @return the result of interpreting the object as an instance of '<em>Style Property</em>'.
113:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
114:          * @generated
115:          */
116:         public T caseBackgroundStyleProperty(VTBackgroundStyleProperty object) {
117:                 return null;
118:         }
119:
120:         /**
121:          * Returns the result of interpreting the object as an instance of '<em>Style Property</em>'.
122:          * <!-- begin-user-doc -->
123:          * This implementation returns null;
124:          * returning a non-null result will terminate the switch.
125:          * <!-- end-user-doc -->
126:          *
127:          * @param object the target of the switch.
128:          * @return the result of interpreting the object as an instance of '<em>Style Property</em>'.
129:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
130:          * @generated
131:          */
132:         public T caseStyleProperty(VTStyleProperty object) {
133:                 return null;
134:         }
135:
136:         /**
137:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
138:          * <!-- begin-user-doc -->
139:          * This implementation returns null;
140:          * returning a non-null result will terminate the switch, but this is the last case anyway.
141:          * <!-- end-user-doc -->
142:          *
143:          * @param object the target of the switch.
144:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
145:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
146:          * @generated
147:          */
148:         @Override
149:         public T defaultCase(EObject object) {
150:                 return null;
151:         }
152:
153: } // BackgroundSwitch