Skip to content

Package: GroupedGridSwitch

GroupedGridSwitch

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