Skip to content

Package: CustomSwitch

CustomSwitch

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