Skip to content

Package: VerticalSwitch

VerticalSwitch

nameinstructionbranchcomplexitylinemethod
VerticalSwitch()
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%
caseContainedContainer(VContainedContainer)
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%
caseContainedElement(VContainedElement)
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%
caseContainer(VContainer)
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%
caseElement(VElement)
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%
caseVerticalLayout(VVerticalLayout)
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: 24 C: 21
47%
M: 6 C: 6
50%
M: 6 C: 1
14%
M: 6 C: 9
60%
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-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: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.vertical.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.spi.model.VContainedContainer;
20: import org.eclipse.emf.ecp.view.spi.model.VContainedElement;
21: import org.eclipse.emf.ecp.view.spi.model.VContainer;
22: import org.eclipse.emf.ecp.view.spi.model.VElement;
23: import org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalLayout;
24: import org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalPackage;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * The <b>Switch</b> for the model's inheritance hierarchy.
29: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
30: * class of the model,
31: * starting with the actual class of the object
32: * and proceeding up the inheritance hierarchy
33: * until a non-null result is returned,
34: * which is the result of the switch.
35: *
36: * @since 1.2
37: * <!-- end-user-doc -->
38: *
39: * @see org.eclipse.emf.ecp.view.spi.vertical.model.VVerticalPackage
40: * @generated
41: */
42: public class VerticalSwitch<T> extends Switch<T> {
43:         /**
44:          * The cached model package
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         protected static VVerticalPackage modelPackage;
51:
52:         /**
53:          * Creates an instance of the switch.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @generated
58:          */
59:         public VerticalSwitch() {
60:•                if (modelPackage == null) {
61:                         modelPackage = VVerticalPackage.eINSTANCE;
62:                 }
63:         }
64:
65:         /**
66:          * Checks whether this is a switch for the given package.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @parameter ePackage the package in question.
71:          * @return whether this is a switch for the given package.
72:          * @generated
73:          */
74:         @Override
75:         protected boolean isSwitchFor(EPackage ePackage) {
76:•                return ePackage == modelPackage;
77:         }
78:
79:         /**
80:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
81:          * result.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @return the first non-null result returned by a <code>caseXXX</code> call.
86:          * @generated
87:          */
88:         @Override
89:         protected T doSwitch(int classifierID, EObject theEObject) {
90:•                switch (classifierID) {
91:                 case VVerticalPackage.VERTICAL_LAYOUT: {
92:                         final VVerticalLayout verticalLayout = (VVerticalLayout) theEObject;
93:                         T result = caseVerticalLayout(verticalLayout);
94:•                        if (result == null) {
95:                                 result = caseContainedContainer(verticalLayout);
96:                         }
97:•                        if (result == null) {
98:                                 result = caseContainedElement(verticalLayout);
99:                         }
100:•                        if (result == null) {
101:                                 result = caseContainer(verticalLayout);
102:                         }
103:•                        if (result == null) {
104:                                 result = caseElement(verticalLayout);
105:                         }
106:•                        if (result == null) {
107:                                 result = defaultCase(theEObject);
108:                         }
109:                         return result;
110:                 }
111:                 default:
112:                         return defaultCase(theEObject);
113:                 }
114:         }
115:
116:         /**
117:          * Returns the result of interpreting the object as an instance of '<em>Layout</em>'.
118:          * <!-- begin-user-doc -->
119:          * This implementation returns null;
120:          * returning a non-null result will terminate the switch.
121:          * <!-- end-user-doc -->
122:          *
123:          * @param object the target of the switch.
124:          * @return the result of interpreting the object as an instance of '<em>Layout</em>'.
125:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
126:          * @generated
127:          */
128:         public T caseVerticalLayout(VVerticalLayout object) {
129:                 return null;
130:         }
131:
132:         /**
133:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
134:          * <!-- begin-user-doc -->
135:          * This implementation returns null;
136:          * returning a non-null result will terminate the switch.
137:          * <!-- end-user-doc -->
138:          *
139:          * @param object the target of the switch.
140:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
141:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
142:          * @generated
143:          */
144:         public T caseElement(VElement object) {
145:                 return null;
146:         }
147:
148:         /**
149:          * Returns the result of interpreting the object as an instance of '<em>Contained Element</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>Contained Element</em>'.
157:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
158:          * @generated
159:          */
160:         public T caseContainedElement(VContainedElement object) {
161:                 return null;
162:         }
163:
164:         /**
165:          * Returns the result of interpreting the object as an instance of '<em>Container</em>'.
166:          * <!-- begin-user-doc -->
167:          * This implementation returns null;
168:          * returning a non-null result will terminate the switch.
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>Container</em>'.
173:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
174:          * @generated
175:          */
176:         public T caseContainer(VContainer object) {
177:                 return null;
178:         }
179:
180:         /**
181:          * Returns the result of interpreting the object as an instance of '<em>Contained Container</em>'.
182:          * <!-- begin-user-doc -->
183:          * This implementation returns null;
184:          * returning a non-null result will terminate the switch.
185:          *
186:          * @since 1.4
187:          * <!-- end-user-doc -->
188:          *
189:          * @param object the target of the switch.
190:          * @return the result of interpreting the object as an instance of '<em>Contained Container</em>'.
191:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
192:          * @generated
193:          */
194:         public T caseContainedContainer(VContainedContainer object) {
195:                 return null;
196:         }
197:
198:         /**
199:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
200:          * <!-- begin-user-doc -->
201:          * This implementation returns null;
202:          * returning a non-null result will terminate the switch, but this is the last case anyway.
203:          * <!-- end-user-doc -->
204:          *
205:          * @param object the target of the switch.
206:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
207:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
208:          * @generated
209:          */
210:         @Override
211:         public T defaultCase(EObject object) {
212:                 return null;
213:         }
214:
215: } // VerticalSwitch