Skip to content

Package: AlignmentSwitch

AlignmentSwitch

nameinstructionbranchcomplexitylinemethod
AlignmentSwitch()
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%
caseAlignmentStyleProperty(VTAlignmentStyleProperty)
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%
caseControlLabelAlignmentStyleProperty(VTControlLabelAlignmentStyleProperty)
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: 20 C: 28
58%
M: 5 C: 6
55%
M: 5 C: 2
29%
M: 5 C: 11
69%
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-2014 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.alignment.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.alignment.model.VTAlignmentPackage;
21: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTAlignmentStyleProperty;
22: import org.eclipse.emf.ecp.view.template.style.alignment.model.VTControlLabelAlignmentStyleProperty;
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)} to invoke the <code>caseXXX</code> method for each
28: * 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.alignment.model.VTAlignmentPackage
36: * @generated
37: */
38: public class AlignmentSwitch<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 VTAlignmentPackage modelPackage;
47:
48:         /**
49:          * Creates an instance of the switch.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         public AlignmentSwitch() {
56:•                if (modelPackage == null) {
57:                         modelPackage = VTAlignmentPackage.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 VTAlignmentPackage.ALIGNMENT_STYLE_PROPERTY: {
88:                         final VTAlignmentStyleProperty alignmentStyleProperty = (VTAlignmentStyleProperty) theEObject;
89:                         T result = caseAlignmentStyleProperty(alignmentStyleProperty);
90:•                        if (result == null) {
91:                                 result = caseStyleProperty(alignmentStyleProperty);
92:                         }
93:•                        if (result == null) {
94:                                 result = defaultCase(theEObject);
95:                         }
96:                         return result;
97:                 }
98:                 case VTAlignmentPackage.CONTROL_LABEL_ALIGNMENT_STYLE_PROPERTY: {
99:                         final VTControlLabelAlignmentStyleProperty controlLabelAlignmentStyleProperty = (VTControlLabelAlignmentStyleProperty) theEObject;
100:                         T result = caseControlLabelAlignmentStyleProperty(controlLabelAlignmentStyleProperty);
101:•                        if (result == null) {
102:                                 result = caseStyleProperty(controlLabelAlignmentStyleProperty);
103:                         }
104:•                        if (result == null) {
105:                                 result = defaultCase(theEObject);
106:                         }
107:                         return result;
108:                 }
109:                 default:
110:                         return defaultCase(theEObject);
111:                 }
112:         }
113:
114:         /**
115:          * Returns the result of interpreting the object as an instance of '<em>Style Property</em>'.
116:          * <!-- begin-user-doc -->
117:          * This implementation returns null;
118:          * returning a non-null result will terminate the switch.
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>Style Property</em>'.
123:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
124:          * @generated
125:          */
126:         public T caseAlignmentStyleProperty(VTAlignmentStyleProperty object) {
127:                 return null;
128:         }
129:
130:         /**
131:          * Returns the result of interpreting the object as an instance of '<em>Control Label Alignment Style
132:          * Property</em>'.
133:          * <!-- begin-user-doc -->
134:          * This implementation returns null;
135:          * returning a non-null result will terminate the switch.
136:          * <!-- end-user-doc -->
137:          *
138:          * @param object the target of the switch.
139:          * @return the result of interpreting the object as an instance of '<em>Control Label Alignment Style
140:          * Property</em>'.
141:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
142:          * @generated
143:          */
144:         public T caseControlLabelAlignmentStyleProperty(VTControlLabelAlignmentStyleProperty object) {
145:                 return null;
146:         }
147:
148:         /**
149:          * Returns the result of interpreting the object as an instance of '<em>Style Property</em>'.
150:          * <!-- begin-user-doc -->
151:          * This implementation returns null;
152:          * returning a non-null result will terminate the switch.
153:          * <!-- end-user-doc -->
154:          *
155:          * @param object the target of the switch.
156:          * @return the result of interpreting the object as an instance of '<em>Style Property</em>'.
157:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
158:          * @generated
159:          */
160:         public T caseStyleProperty(VTStyleProperty object) {
161:                 return null;
162:         }
163:
164:         /**
165:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
166:          * <!-- begin-user-doc -->
167:          * This implementation returns null;
168:          * returning a non-null result will terminate the switch, but this is the last case anyway.
169:          * <!-- end-user-doc -->
170:          *
171:          * @param object the target of the switch.
172:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
173:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
174:          * @generated
175:          */
176:         @Override
177:         public T defaultCase(EObject object) {
178:                 return null;
179:         }
180:
181: } // AlignmentSwitch