Skip to content

Package: SectionSwitch

SectionSwitch

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