Skip to content

Package: GroupSwitch

GroupSwitch

nameinstructionbranchcomplexitylinemethod
GroupSwitch()
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%
caseGroup(VGroup)
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%
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: 28 C: 23
45%
M: 7 C: 7
50%
M: 7 C: 1
13%
M: 7 C: 10
59%
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.group.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.group.model.VGroup;
20: import org.eclipse.emf.ecp.view.spi.group.model.VGroupPackage;
21: import org.eclipse.emf.ecp.view.spi.model.VContainedContainer;
22: import org.eclipse.emf.ecp.view.spi.model.VContainedElement;
23: import org.eclipse.emf.ecp.view.spi.model.VContainer;
24: import org.eclipse.emf.ecp.view.spi.model.VElement;
25: import org.eclipse.emf.ecp.view.spi.model.VHasTooltip;
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.group.model.VGroupPackage
39: * @generated
40: */
41: public class GroupSwitch<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 VGroupPackage modelPackage;
50:
51:         /**
52:          * Creates an instance of the switch.
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         public GroupSwitch() {
59:•                if (modelPackage == null) {
60:                         modelPackage = VGroupPackage.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 VGroupPackage.GROUP: {
91:                         final VGroup group = (VGroup) theEObject;
92:                         T result = caseGroup(group);
93:•                        if (result == null) {
94:                                 result = caseContainedContainer(group);
95:                         }
96:•                        if (result == null) {
97:                                 result = caseHasTooltip(group);
98:                         }
99:•                        if (result == null) {
100:                                 result = caseContainedElement(group);
101:                         }
102:•                        if (result == null) {
103:                                 result = caseContainer(group);
104:                         }
105:•                        if (result == null) {
106:                                 result = caseElement(group);
107:                         }
108:•                        if (result == null) {
109:                                 result = defaultCase(theEObject);
110:                         }
111:                         return result;
112:                 }
113:                 default:
114:                         return defaultCase(theEObject);
115:                 }
116:         }
117:
118:         /**
119:          * Returns the result of interpreting the object as an instance of '<em>Group</em>'.
120:          * <!-- begin-user-doc -->
121:          * This implementation returns null;
122:          * returning a non-null result will terminate the switch.
123:          * <!-- end-user-doc -->
124:          *
125:          * @param object the target of the switch.
126:          * @return the result of interpreting the object as an instance of '<em>Group</em>'.
127:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
128:          * @generated
129:          */
130:         public T caseGroup(VGroup object) {
131:                 return null;
132:         }
133:
134:         /**
135:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
136:          * <!-- begin-user-doc -->
137:          * This implementation returns null;
138:          * returning a non-null result will terminate the switch.
139:          * <!-- end-user-doc -->
140:          *
141:          * @param object the target of the switch.
142:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
143:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
144:          * @generated
145:          */
146:         public T caseElement(VElement object) {
147:                 return null;
148:         }
149:
150:         /**
151:          * Returns the result of interpreting the object as an instance of '<em>Contained Element</em>'.
152:          * <!-- begin-user-doc -->
153:          * This implementation returns null;
154:          * returning a non-null result will terminate the switch.
155:          * <!-- end-user-doc -->
156:          *
157:          * @param object the target of the switch.
158:          * @return the result of interpreting the object as an instance of '<em>Contained Element</em>'.
159:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
160:          * @generated
161:          */
162:         public T caseContainedElement(VContainedElement object) {
163:                 return null;
164:         }
165:
166:         /**
167:          * Returns the result of interpreting the object as an instance of '<em>Container</em>'.
168:          * <!-- begin-user-doc -->
169:          * This implementation returns null;
170:          * returning a non-null result will terminate the switch.
171:          * <!-- end-user-doc -->
172:          *
173:          * @param object the target of the switch.
174:          * @return the result of interpreting the object as an instance of '<em>Container</em>'.
175:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
176:          * @generated
177:          */
178:         public T caseContainer(VContainer object) {
179:                 return null;
180:         }
181:
182:         /**
183:          * Returns the result of interpreting the object as an instance of '<em>Contained Container</em>'.
184:          * <!-- begin-user-doc -->
185:          * This implementation returns null;
186:          * returning a non-null result will terminate the switch.
187:          *
188:          * @since 1.4
189:          * <!-- end-user-doc -->
190:          * @param object the target of the switch.
191:          * @return the result of interpreting the object as an instance of '<em>Contained Container</em>'.
192:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
193:          * @generated
194:          */
195:         public T caseContainedContainer(VContainedContainer object) {
196:                 return null;
197:         }
198:
199:         /**
200:          * Returns the result of interpreting the object as an instance of '<em>Has Tooltip</em>'.
201:          * <!-- begin-user-doc -->
202:          * This implementation returns null;
203:          * returning a non-null result will terminate the switch.
204:          * <!-- end-user-doc -->
205:          *
206:          * @param object the target of the switch.
207:          * @return the result of interpreting the object as an instance of '<em>Has Tooltip</em>'.
208:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
209:          * @generated
210:          * @since 1.13
211:          */
212:         public T caseHasTooltip(VHasTooltip object) {
213:                 return null;
214:         }
215:
216:         /**
217:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
218:          * <!-- begin-user-doc -->
219:          * This implementation returns null;
220:          * returning a non-null result will terminate the switch, but this is the last case anyway.
221:          * <!-- end-user-doc -->
222:          *
223:          * @param object the target of the switch.
224:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
225:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
226:          * @generated
227:          */
228:         @Override
229:         public T defaultCase(EObject object) {
230:                 return null;
231:         }
232:
233: } // GroupSwitch