Skip to content

Package: ControlgridSwitch

ControlgridSwitch

nameinstructionbranchcomplexitylinemethod
ControlgridSwitch()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 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%
caseControlGrid(VControlGrid)
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%
caseControlGridCell(VControlGridCell)
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%
caseControlGridRow(VControlGridRow)
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%
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: 63 C: 0
0%
M: 14 C: 0
0%
M: 9 C: 0
0%
M: 21 C: 0
0%
M: 1 C: 0
0%
isSwitchFor(EPackage)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2015 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.emfforms.spi.view.controlgrid.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.VElement;
21: import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGrid;
22: import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGridCell;
23: import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlGridRow;
24: import org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlgridPackage;
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)}
30: * to invoke the <code>caseXXX</code> method for each 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: * <!-- end-user-doc -->
36: *
37: * @see org.eclipse.emf.emfforms.spi.view.controlgrid.model.VControlgridPackage
38: * @generated
39: */
40: public class ControlgridSwitch<T> extends Switch<T> {
41:         /**
42:          * The cached model package
43:          * <!-- begin-user-doc -->
44:          * <!-- end-user-doc -->
45:          *
46:          * @generated
47:          */
48:         protected static VControlgridPackage modelPackage;
49:
50:         /**
51:          * Creates an instance of the switch.
52:          * <!-- begin-user-doc -->
53:          * <!-- end-user-doc -->
54:          *
55:          * @generated
56:          */
57:         public ControlgridSwitch() {
58:•                if (modelPackage == null) {
59:                         modelPackage = VControlgridPackage.eINSTANCE;
60:                 }
61:         }
62:
63:         /**
64:          * Checks whether this is a switch for the given package.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @param ePackage the package in question.
69:          * @return whether this is a switch for the given package.
70:          * @generated
71:          */
72:         @Override
73:         protected boolean isSwitchFor(EPackage ePackage) {
74:•                return ePackage == modelPackage;
75:         }
76:
77:         /**
78:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
79:          * result.
80:          * <!-- begin-user-doc -->
81:          * <!-- end-user-doc -->
82:          *
83:          * @return the first non-null result returned by a <code>caseXXX</code> call.
84:          * @generated
85:          */
86:         @Override
87:         protected T doSwitch(int classifierID, EObject theEObject) {
88:•                switch (classifierID) {
89:                 case VControlgridPackage.CONTROL_GRID: {
90:                         final VControlGrid controlGrid = (VControlGrid) theEObject;
91:                         T result = caseControlGrid(controlGrid);
92:•                        if (result == null) {
93:                                 result = caseContainedElement(controlGrid);
94:                         }
95:•                        if (result == null) {
96:                                 result = caseElement(controlGrid);
97:                         }
98:•                        if (result == null) {
99:                                 result = defaultCase(theEObject);
100:                         }
101:                         return result;
102:                 }
103:                 case VControlgridPackage.CONTROL_GRID_ROW: {
104:                         final VControlGridRow controlGridRow = (VControlGridRow) theEObject;
105:                         T result = caseControlGridRow(controlGridRow);
106:•                        if (result == null) {
107:                                 result = defaultCase(theEObject);
108:                         }
109:                         return result;
110:                 }
111:                 case VControlgridPackage.CONTROL_GRID_CELL: {
112:                         final VControlGridCell controlGridCell = (VControlGridCell) theEObject;
113:                         T result = caseControlGridCell(controlGridCell);
114:•                        if (result == null) {
115:                                 result = defaultCase(theEObject);
116:                         }
117:                         return result;
118:                 }
119:                 default:
120:                         return defaultCase(theEObject);
121:                 }
122:         }
123:
124:         /**
125:          * Returns the result of interpreting the object as an instance of '<em>Control Grid</em>'.
126:          * <!-- begin-user-doc -->
127:          * This implementation returns null;
128:          * returning a non-null result will terminate the switch.
129:          * <!-- end-user-doc -->
130:          *
131:          * @param object the target of the switch.
132:          * @return the result of interpreting the object as an instance of '<em>Control Grid</em>'.
133:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
134:          * @generated
135:          */
136:         public T caseControlGrid(VControlGrid object) {
137:                 return null;
138:         }
139:
140:         /**
141:          * Returns the result of interpreting the object as an instance of '<em>Control Grid Row</em>'.
142:          * <!-- begin-user-doc -->
143:          * This implementation returns null;
144:          * returning a non-null result will terminate the switch.
145:          * <!-- end-user-doc -->
146:          *
147:          * @param object the target of the switch.
148:          * @return the result of interpreting the object as an instance of '<em>Control Grid Row</em>'.
149:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
150:          * @generated
151:          */
152:         public T caseControlGridRow(VControlGridRow object) {
153:                 return null;
154:         }
155:
156:         /**
157:          * Returns the result of interpreting the object as an instance of '<em>Control Grid Cell</em>'.
158:          * <!-- begin-user-doc -->
159:          * This implementation returns null;
160:          * returning a non-null result will terminate the switch.
161:          * <!-- end-user-doc -->
162:          *
163:          * @param object the target of the switch.
164:          * @return the result of interpreting the object as an instance of '<em>Control Grid Cell</em>'.
165:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
166:          * @generated
167:          */
168:         public T caseControlGridCell(VControlGridCell object) {
169:                 return null;
170:         }
171:
172:         /**
173:          * Returns the result of interpreting the object as an instance of '<em>Element</em>'.
174:          * <!-- begin-user-doc -->
175:          * This implementation returns null;
176:          * returning a non-null result will terminate the switch.
177:          * <!-- end-user-doc -->
178:          *
179:          * @param object the target of the switch.
180:          * @return the result of interpreting the object as an instance of '<em>Element</em>'.
181:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
182:          * @generated
183:          */
184:         public T caseElement(VElement object) {
185:                 return null;
186:         }
187:
188:         /**
189:          * Returns the result of interpreting the object as an instance of '<em>Contained Element</em>'.
190:          * <!-- begin-user-doc -->
191:          * This implementation returns null;
192:          * returning a non-null result will terminate the switch.
193:          * <!-- end-user-doc -->
194:          *
195:          * @param object the target of the switch.
196:          * @return the result of interpreting the object as an instance of '<em>Contained Element</em>'.
197:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
198:          * @generated
199:          */
200:         public T caseContainedElement(VContainedElement object) {
201:                 return null;
202:         }
203:
204:         /**
205:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
206:          * <!-- begin-user-doc -->
207:          * This implementation returns null;
208:          * returning a non-null result will terminate the switch, but this is the last case anyway.
209:          * <!-- end-user-doc -->
210:          *
211:          * @param object the target of the switch.
212:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
213:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
214:          * @generated
215:          */
216:         @Override
217:         public T defaultCase(EObject object) {
218:                 return null;
219:         }
220:
221: } // ControlgridSwitch