Skip to content

Package: TableSwitch

TableSwitch

nameinstructionbranchcomplexitylinemethod
TableSwitch()
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%
caseControl(VControl)
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%
caseDomainModelReference(VDomainModelReference)
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%
caseEnablementConfiguration(VEnablementConfiguration)
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%
caseFeaturePathDomainModelReference(VFeaturePathDomainModelReference)
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%
caseReadOnlyColumnConfiguration(VReadOnlyColumnConfiguration)
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%
caseSingleColumnConfiguration(VSingleColumnConfiguration)
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%
caseTableColumnConfiguration(VTableColumnConfiguration)
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%
caseTableControl(VTableControl)
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%
caseTableDomainModelReference(VTableDomainModelReference)
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%
caseWidthConfiguration(VWidthConfiguration)
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: 104 C: 79
43%
M: 25 C: 21
46%
M: 22 C: 5
19%
M: 29 C: 32
52%
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.table.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.VControl;
21: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.model.VElement;
23: import org.eclipse.emf.ecp.view.spi.model.VFeaturePathDomainModelReference;
24: import org.eclipse.emf.ecp.view.spi.table.model.VEnablementConfiguration;
25: import org.eclipse.emf.ecp.view.spi.table.model.VReadOnlyColumnConfiguration;
26: import org.eclipse.emf.ecp.view.spi.table.model.VSingleColumnConfiguration;
27: import org.eclipse.emf.ecp.view.spi.table.model.VTableColumnConfiguration;
28: import org.eclipse.emf.ecp.view.spi.table.model.VTableControl;
29: import org.eclipse.emf.ecp.view.spi.table.model.VTableDomainModelReference;
30: import org.eclipse.emf.ecp.view.spi.table.model.VTablePackage;
31: import org.eclipse.emf.ecp.view.spi.table.model.VWidthConfiguration;
32:
33: /**
34: * <!-- begin-user-doc -->
35: * The <b>Switch</b> for the model's inheritance hierarchy.
36: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
37: * class of the model,
38: * starting with the actual class of the object
39: * and proceeding up the inheritance hierarchy
40: * until a non-null result is returned,
41: * which is the result of the switch.
42: * <!-- end-user-doc -->
43: *
44: * @see org.eclipse.emf.ecp.view.spi.table.model.VTablePackage
45: * @generated
46: */
47: public class TableSwitch<T> extends Switch<T> {
48:         /**
49:          * The cached model package
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         protected static VTablePackage modelPackage;
56:
57:         /**
58:          * Creates an instance of the switch.
59:          * <!-- begin-user-doc -->
60:          * <!-- end-user-doc -->
61:          *
62:          * @generated
63:          */
64:         public TableSwitch() {
65:•                if (modelPackage == null) {
66:                         modelPackage = VTablePackage.eINSTANCE;
67:                 }
68:         }
69:
70:         /**
71:          * Checks whether this is a switch for the given package.
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @param ePackage the package in question.
76:          * @return whether this is a switch for the given package.
77:          * @generated
78:          */
79:         @Override
80:         protected boolean isSwitchFor(EPackage ePackage) {
81:•                return ePackage == modelPackage;
82:         }
83:
84:         /**
85:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
86:          * result.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @return the first non-null result returned by a <code>caseXXX</code> call.
91:          * @generated
92:          */
93:         @Override
94:         protected T doSwitch(int classifierID, EObject theEObject) {
95:•                switch (classifierID) {
96:                 case VTablePackage.TABLE_CONTROL: {
97:                         final VTableControl tableControl = (VTableControl) theEObject;
98:                         T result = caseTableControl(tableControl);
99:•                        if (result == null) {
100:                                 result = caseControl(tableControl);
101:                         }
102:•                        if (result == null) {
103:                                 result = caseContainedElement(tableControl);
104:                         }
105:•                        if (result == null) {
106:                                 result = caseElement(tableControl);
107:                         }
108:•                        if (result == null) {
109:                                 result = defaultCase(theEObject);
110:                         }
111:                         return result;
112:                 }
113:                 case VTablePackage.TABLE_COLUMN_CONFIGURATION: {
114:                         final VTableColumnConfiguration tableColumnConfiguration = (VTableColumnConfiguration) theEObject;
115:                         T result = caseTableColumnConfiguration(tableColumnConfiguration);
116:•                        if (result == null) {
117:                                 result = defaultCase(theEObject);
118:                         }
119:                         return result;
120:                 }
121:                 case VTablePackage.TABLE_DOMAIN_MODEL_REFERENCE: {
122:                         final VTableDomainModelReference tableDomainModelReference = (VTableDomainModelReference) theEObject;
123:                         T result = caseTableDomainModelReference(tableDomainModelReference);
124:•                        if (result == null) {
125:                                 result = caseFeaturePathDomainModelReference(tableDomainModelReference);
126:                         }
127:•                        if (result == null) {
128:                                 result = caseDomainModelReference(tableDomainModelReference);
129:                         }
130:•                        if (result == null) {
131:                                 result = defaultCase(theEObject);
132:                         }
133:                         return result;
134:                 }
135:                 case VTablePackage.READ_ONLY_COLUMN_CONFIGURATION: {
136:                         final VReadOnlyColumnConfiguration readOnlyColumnConfiguration = (VReadOnlyColumnConfiguration) theEObject;
137:                         T result = caseReadOnlyColumnConfiguration(readOnlyColumnConfiguration);
138:•                        if (result == null) {
139:                                 result = caseTableColumnConfiguration(readOnlyColumnConfiguration);
140:                         }
141:•                        if (result == null) {
142:                                 result = defaultCase(theEObject);
143:                         }
144:                         return result;
145:                 }
146:                 case VTablePackage.WIDTH_CONFIGURATION: {
147:                         final VWidthConfiguration widthConfiguration = (VWidthConfiguration) theEObject;
148:                         T result = caseWidthConfiguration(widthConfiguration);
149:•                        if (result == null) {
150:                                 result = caseSingleColumnConfiguration(widthConfiguration);
151:                         }
152:•                        if (result == null) {
153:                                 result = caseTableColumnConfiguration(widthConfiguration);
154:                         }
155:•                        if (result == null) {
156:                                 result = defaultCase(theEObject);
157:                         }
158:                         return result;
159:                 }
160:                 case VTablePackage.ENABLEMENT_CONFIGURATION: {
161:                         final VEnablementConfiguration enablementConfiguration = (VEnablementConfiguration) theEObject;
162:                         T result = caseEnablementConfiguration(enablementConfiguration);
163:•                        if (result == null) {
164:                                 result = caseElement(enablementConfiguration);
165:                         }
166:•                        if (result == null) {
167:                                 result = caseSingleColumnConfiguration(enablementConfiguration);
168:                         }
169:•                        if (result == null) {
170:                                 result = caseTableColumnConfiguration(enablementConfiguration);
171:                         }
172:•                        if (result == null) {
173:                                 result = defaultCase(theEObject);
174:                         }
175:                         return result;
176:                 }
177:                 case VTablePackage.SINGLE_COLUMN_CONFIGURATION: {
178:                         final VSingleColumnConfiguration singleColumnConfiguration = (VSingleColumnConfiguration) theEObject;
179:                         T result = caseSingleColumnConfiguration(singleColumnConfiguration);
180:•                        if (result == null) {
181:                                 result = caseTableColumnConfiguration(singleColumnConfiguration);
182:                         }
183:•                        if (result == null) {
184:                                 result = defaultCase(theEObject);
185:                         }
186:                         return result;
187:                 }
188:                 default:
189:                         return defaultCase(theEObject);
190:                 }
191:         }
192:
193:         /**
194:          * Returns the result of interpreting the object as an instance of '<em>Control</em>'.
195:          * <!-- begin-user-doc -->
196:          * This implementation returns null;
197:          * returning a non-null result will terminate the switch.
198:          * <!-- end-user-doc -->
199:          *
200:          * @param object the target of the switch.
201:          * @return the result of interpreting the object as an instance of '<em>Control</em>'.
202:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
203:          * @generated
204:          */
205:         public T caseTableControl(VTableControl object) {
206:                 return null;
207:         }
208:
209:         /**
210:          * Returns the result of interpreting the object as an instance of '<em>Column Configuration</em>'.
211:          * <!-- begin-user-doc -->
212:          * This implementation returns null;
213:          * returning a non-null result will terminate the switch.
214:          * <!-- end-user-doc -->
215:          *
216:          * @param object the target of the switch.
217:          * @return the result of interpreting the object as an instance of '<em>Column Configuration</em>'.
218:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
219:          * @generated
220:          */
221:         public T caseTableColumnConfiguration(VTableColumnConfiguration object) {
222:                 return null;
223:         }
224:
225:         /**
226:          * Returns the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
227:          * <!-- begin-user-doc -->
228:          * This implementation returns null;
229:          * returning a non-null result will terminate the switch.
230:          * <!-- end-user-doc -->
231:          *
232:          * @param object the target of the switch.
233:          * @return the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
234:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
235:          * @generated
236:          */
237:         public T caseTableDomainModelReference(VTableDomainModelReference object) {
238:                 return null;
239:         }
240:
241:         /**
242:          * Returns the result of interpreting the object as an instance of '<em>Read Only Column Configuration</em>'.
243:          * <!-- begin-user-doc -->
244:          * This implementation returns null;
245:          * returning a non-null result will terminate the switch.
246:          * <!-- end-user-doc -->
247:          *
248:          * @param object the target of the switch.
249:          * @return the result of interpreting the object as an instance of '<em>Read Only Column Configuration</em>'.
250:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
251:          * @generated
252:          */
253:         public T caseReadOnlyColumnConfiguration(VReadOnlyColumnConfiguration object) {
254:                 return null;
255:         }
256:
257:         /**
258:          * Returns the result of interpreting the object as an instance of '<em>Width Configuration</em>'.
259:          * <!-- begin-user-doc -->
260:          * This implementation returns null;
261:          * returning a non-null result will terminate the switch.
262:          *
263:          * @since 1.9
264:          * <!-- end-user-doc -->
265:          * @param object the target of the switch.
266:          * @return the result of interpreting the object as an instance of '<em>Width Configuration</em>'.
267:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
268:          * @generated
269:          */
270:         public T caseWidthConfiguration(VWidthConfiguration object) {
271:                 return null;
272:         }
273:
274:         /**
275:          * Returns the result of interpreting the object as an instance of '<em>Enablement Configuration</em>'.
276:          * <!-- begin-user-doc -->
277:          * This implementation returns null;
278:          * returning a non-null result will terminate the switch.
279:          *
280:          * @since 1.13
281:          * <!-- end-user-doc -->
282:          * @param object the target of the switch.
283:          * @return the result of interpreting the object as an instance of '<em>Enablement Configuration</em>'.
284:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
285:          * @generated
286:          */
287:         public T caseEnablementConfiguration(VEnablementConfiguration object) {
288:                 return null;
289:         }
290:
291:         /**
292:          * Returns the result of interpreting the object as an instance of '<em>Single Column Configuration</em>'.
293:          * <!-- begin-user-doc -->
294:          * This implementation returns null;
295:          * returning a non-null result will terminate the switch.
296:          *
297:          * @since 1.13
298:          * <!-- end-user-doc -->
299:          * @param object the target of the switch.
300:          * @return the result of interpreting the object as an instance of '<em>Single Column Configuration</em>'.
301:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
302:          * @generated
303:          */
304:         public T caseSingleColumnConfiguration(VSingleColumnConfiguration object) {
305:                 return null;
306:         }
307:
308:         /**
309:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
310:          * <!-- begin-user-doc -->
311:          * This implementation returns null;
312:          * returning a non-null result will terminate the switch.
313:          * <!-- end-user-doc -->
314:          *
315:          * @param object the target of the switch.
316:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
317:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
318:          * @generated
319:          */
320:         public T caseElement(VElement object) {
321:                 return null;
322:         }
323:
324:         /**
325:          * Returns the result of interpreting the object as an instance of '<em>Contained Element</em>'.
326:          * <!-- begin-user-doc -->
327:          * This implementation returns null;
328:          * returning a non-null result will terminate the switch.
329:          * <!-- end-user-doc -->
330:          *
331:          * @param object the target of the switch.
332:          * @return the result of interpreting the object as an instance of '<em>Contained Element</em>'.
333:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
334:          * @generated
335:          */
336:         public T caseContainedElement(VContainedElement object) {
337:                 return null;
338:         }
339:
340:         /**
341:          * Returns the result of interpreting the object as an instance of '<em>Control</em>'.
342:          * <!-- begin-user-doc -->
343:          * This implementation returns null;
344:          * returning a non-null result will terminate the switch.
345:          * <!-- end-user-doc -->
346:          *
347:          * @param object the target of the switch.
348:          * @return the result of interpreting the object as an instance of '<em>Control</em>'.
349:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
350:          * @generated
351:          */
352:         public T caseControl(VControl object) {
353:                 return null;
354:         }
355:
356:         /**
357:          * Returns the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
358:          * <!-- begin-user-doc -->
359:          * This implementation returns null;
360:          * returning a non-null result will terminate the switch.
361:          * <!-- end-user-doc -->
362:          *
363:          * @param object the target of the switch.
364:          * @return the result of interpreting the object as an instance of '<em>Domain Model Reference</em>'.
365:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
366:          * @generated
367:          */
368:         public T caseDomainModelReference(VDomainModelReference object) {
369:                 return null;
370:         }
371:
372:         /**
373:          * Returns the result of interpreting the object as an instance of '<em>Feature Path Domain Model Reference</em>'.
374:          * <!-- begin-user-doc -->
375:          * This implementation returns null;
376:          * returning a non-null result will terminate the switch.
377:          * <!-- end-user-doc -->
378:          *
379:          * @param object the target of the switch.
380:          * @return the result of interpreting the object as an instance of '<em>Feature Path Domain Model Reference</em>'.
381:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
382:          * @generated
383:          */
384:         public T caseFeaturePathDomainModelReference(VFeaturePathDomainModelReference object) {
385:                 return null;
386:         }
387:
388:         /**
389:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
390:          * <!-- begin-user-doc -->
391:          * This implementation returns null;
392:          * returning a non-null result will terminate the switch, but this is the last case anyway.
393:          * <!-- end-user-doc -->
394:          *
395:          * @param object the target of the switch.
396:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
397:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
398:          * @generated
399:          */
400:         @Override
401:         public T defaultCase(EObject object) {
402:                 return null;
403:         }
404:
405: } // TableSwitch