Skip to content

Package: RuleSwitch

RuleSwitch

nameinstructionbranchcomplexitylinemethod
RuleSwitch()
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%
caseAndCondition(AndCondition)
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%
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%
caseCondition(Condition)
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%
caseEnableRule(EnableRule)
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%
caseFalse(False)
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%
caseIsProxyCondition(IsProxyCondition)
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%
caseIterateCondition(IterateCondition)
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%
caseLeafCondition(LeafCondition)
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%
caseNotCondition(NotCondition)
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%
caseOrCondition(OrCondition)
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%
caseRule(Rule)
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%
caseShowRule(ShowRule)
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%
caseTrue(True)
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: 128 C: 136
52%
M: 31 C: 32
51%
M: 28 C: 10
26%
M: 35 C: 53
60%
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-2018 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: * EclipseSource Munich GmbH - initial API and implementation
13: * Christian W. Damus - bugs 527753, 530900
14: ******************************************************************************/
15: package org.eclipse.emf.ecp.view.spi.rule.model.util;
16:
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.util.Switch;
20: import org.eclipse.emf.ecp.view.spi.model.VAttachment;
21: import org.eclipse.emf.ecp.view.spi.rule.model.AndCondition;
22: import org.eclipse.emf.ecp.view.spi.rule.model.Condition;
23: import org.eclipse.emf.ecp.view.spi.rule.model.EnableRule;
24: import org.eclipse.emf.ecp.view.spi.rule.model.False;
25: import org.eclipse.emf.ecp.view.spi.rule.model.IsProxyCondition;
26: import org.eclipse.emf.ecp.view.spi.rule.model.IterateCondition;
27: import org.eclipse.emf.ecp.view.spi.rule.model.LeafCondition;
28: import org.eclipse.emf.ecp.view.spi.rule.model.NotCondition;
29: import org.eclipse.emf.ecp.view.spi.rule.model.OrCondition;
30: import org.eclipse.emf.ecp.view.spi.rule.model.Rule;
31: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
32: import org.eclipse.emf.ecp.view.spi.rule.model.ShowRule;
33: import org.eclipse.emf.ecp.view.spi.rule.model.True;
34:
35: /**
36: * <!-- begin-user-doc -->
37: * The <b>Switch</b> for the model's inheritance hierarchy.
38: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
39: * class of the model,
40: * starting with the actual class of the object
41: * and proceeding up the inheritance hierarchy
42: * until a non-null result is returned,
43: * which is the result of the switch.
44: *
45: * @since 1.2
46: * <!-- end-user-doc -->
47: * @see org.eclipse.emf.ecp.view.spi.rule.model.RulePackage
48: * @generated
49: */
50: public class RuleSwitch<T> extends Switch<T> {
51:         /**
52:          * The cached model package
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         protected static RulePackage modelPackage;
59:
60:         /**
61:          * Creates an instance of the switch.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @generated
66:          */
67:         public RuleSwitch() {
68:•                if (modelPackage == null) {
69:                         modelPackage = RulePackage.eINSTANCE;
70:                 }
71:         }
72:
73:         /**
74:          * Checks whether this is a switch for the given package.
75:          * <!-- begin-user-doc -->
76:          * <!-- end-user-doc -->
77:          *
78:          * @param ePackage the package in question.
79:          * @return whether this is a switch for the given package.
80:          * @generated
81:          */
82:         @Override
83:         protected boolean isSwitchFor(EPackage ePackage) {
84:•                return ePackage == modelPackage;
85:         }
86:
87:         /**
88:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
89:          * result.
90:          * <!-- begin-user-doc -->
91:          * <!-- end-user-doc -->
92:          *
93:          * @return the first non-null result returned by a <code>caseXXX</code> call.
94:          * @generated
95:          */
96:         @Override
97:         protected T doSwitch(int classifierID, EObject theEObject) {
98:•                switch (classifierID) {
99:                 case RulePackage.CONDITION: {
100:                         final Condition condition = (Condition) theEObject;
101:                         T result = caseCondition(condition);
102:•                        if (result == null) {
103:                                 result = defaultCase(theEObject);
104:                         }
105:                         return result;
106:                 }
107:                 case RulePackage.LEAF_CONDITION: {
108:                         final LeafCondition leafCondition = (LeafCondition) theEObject;
109:                         T result = caseLeafCondition(leafCondition);
110:•                        if (result == null) {
111:                                 result = caseCondition(leafCondition);
112:                         }
113:•                        if (result == null) {
114:                                 result = defaultCase(theEObject);
115:                         }
116:                         return result;
117:                 }
118:                 case RulePackage.OR_CONDITION: {
119:                         final OrCondition orCondition = (OrCondition) theEObject;
120:                         T result = caseOrCondition(orCondition);
121:•                        if (result == null) {
122:                                 result = caseCondition(orCondition);
123:                         }
124:•                        if (result == null) {
125:                                 result = defaultCase(theEObject);
126:                         }
127:                         return result;
128:                 }
129:                 case RulePackage.AND_CONDITION: {
130:                         final AndCondition andCondition = (AndCondition) theEObject;
131:                         T result = caseAndCondition(andCondition);
132:•                        if (result == null) {
133:                                 result = caseCondition(andCondition);
134:                         }
135:•                        if (result == null) {
136:                                 result = defaultCase(theEObject);
137:                         }
138:                         return result;
139:                 }
140:                 case RulePackage.RULE: {
141:                         final Rule rule = (Rule) theEObject;
142:                         T result = caseRule(rule);
143:•                        if (result == null) {
144:                                 result = caseAttachment(rule);
145:                         }
146:•                        if (result == null) {
147:                                 result = defaultCase(theEObject);
148:                         }
149:                         return result;
150:                 }
151:                 case RulePackage.SHOW_RULE: {
152:                         final ShowRule showRule = (ShowRule) theEObject;
153:                         T result = caseShowRule(showRule);
154:•                        if (result == null) {
155:                                 result = caseRule(showRule);
156:                         }
157:•                        if (result == null) {
158:                                 result = caseAttachment(showRule);
159:                         }
160:•                        if (result == null) {
161:                                 result = defaultCase(theEObject);
162:                         }
163:                         return result;
164:                 }
165:                 case RulePackage.ENABLE_RULE: {
166:                         final EnableRule enableRule = (EnableRule) theEObject;
167:                         T result = caseEnableRule(enableRule);
168:•                        if (result == null) {
169:                                 result = caseRule(enableRule);
170:                         }
171:•                        if (result == null) {
172:                                 result = caseAttachment(enableRule);
173:                         }
174:•                        if (result == null) {
175:                                 result = defaultCase(theEObject);
176:                         }
177:                         return result;
178:                 }
179:                 case RulePackage.ITERATE_CONDITION: {
180:                         final IterateCondition iterateCondition = (IterateCondition) theEObject;
181:                         T result = caseIterateCondition(iterateCondition);
182:•                        if (result == null) {
183:                                 result = caseCondition(iterateCondition);
184:                         }
185:•                        if (result == null) {
186:                                 result = defaultCase(theEObject);
187:                         }
188:                         return result;
189:                 }
190:                 case RulePackage.TRUE: {
191:                         final True true_ = (True) theEObject;
192:                         T result = caseTrue(true_);
193:•                        if (result == null) {
194:                                 result = caseCondition(true_);
195:                         }
196:•                        if (result == null) {
197:                                 result = defaultCase(theEObject);
198:                         }
199:                         return result;
200:                 }
201:                 case RulePackage.FALSE: {
202:                         final False false_ = (False) theEObject;
203:                         T result = caseFalse(false_);
204:•                        if (result == null) {
205:                                 result = caseCondition(false_);
206:                         }
207:•                        if (result == null) {
208:                                 result = defaultCase(theEObject);
209:                         }
210:                         return result;
211:                 }
212:                 case RulePackage.NOT_CONDITION: {
213:                         final NotCondition notCondition = (NotCondition) theEObject;
214:                         T result = caseNotCondition(notCondition);
215:•                        if (result == null) {
216:                                 result = caseCondition(notCondition);
217:                         }
218:•                        if (result == null) {
219:                                 result = defaultCase(theEObject);
220:                         }
221:                         return result;
222:                 }
223:                 case RulePackage.IS_PROXY_CONDITION: {
224:                         final IsProxyCondition isProxyCondition = (IsProxyCondition) theEObject;
225:                         T result = caseIsProxyCondition(isProxyCondition);
226:•                        if (result == null) {
227:                                 result = caseCondition(isProxyCondition);
228:                         }
229:•                        if (result == null) {
230:                                 result = defaultCase(theEObject);
231:                         }
232:                         return result;
233:                 }
234:                 default:
235:                         return defaultCase(theEObject);
236:                 }
237:         }
238:
239:         /**
240:          * Returns the result of interpreting the object as an instance of '<em>Condition</em>'.
241:          * <!-- begin-user-doc -->
242:          * This implementation returns null;
243:          * returning a non-null result will terminate the switch.
244:          * <!-- end-user-doc -->
245:          *
246:          * @param object the target of the switch.
247:          * @return the result of interpreting the object as an instance of '<em>Condition</em>'.
248:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
249:          * @generated
250:          */
251:         public T caseCondition(Condition object) {
252:                 return null;
253:         }
254:
255:         /**
256:          * Returns the result of interpreting the object as an instance of '<em>Leaf Condition</em>'.
257:          * <!-- begin-user-doc -->
258:          * This implementation returns null;
259:          * returning a non-null result will terminate the switch.
260:          * <!-- end-user-doc -->
261:          *
262:          * @param object the target of the switch.
263:          * @return the result of interpreting the object as an instance of '<em>Leaf Condition</em>'.
264:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
265:          * @generated
266:          */
267:         public T caseLeafCondition(LeafCondition object) {
268:                 return null;
269:         }
270:
271:         /**
272:          * Returns the result of interpreting the object as an instance of '<em>Or Condition</em>'.
273:          * <!-- begin-user-doc -->
274:          * This implementation returns null;
275:          * returning a non-null result will terminate the switch.
276:          * <!-- end-user-doc -->
277:          *
278:          * @param object the target of the switch.
279:          * @return the result of interpreting the object as an instance of '<em>Or Condition</em>'.
280:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
281:          * @generated
282:          */
283:         public T caseOrCondition(OrCondition object) {
284:                 return null;
285:         }
286:
287:         /**
288:          * Returns the result of interpreting the object as an instance of '<em>And Condition</em>'.
289:          * <!-- begin-user-doc -->
290:          * This implementation returns null;
291:          * returning a non-null result will terminate the switch.
292:          * <!-- end-user-doc -->
293:          *
294:          * @param object the target of the switch.
295:          * @return the result of interpreting the object as an instance of '<em>And Condition</em>'.
296:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
297:          * @generated
298:          */
299:         public T caseAndCondition(AndCondition object) {
300:                 return null;
301:         }
302:
303:         /**
304:          * Returns the result of interpreting the object as an instance of '<em>Rule</em>'.
305:          * <!-- begin-user-doc -->
306:          * This implementation returns null;
307:          * returning a non-null result will terminate the switch.
308:          * <!-- end-user-doc -->
309:          *
310:          * @param object the target of the switch.
311:          * @return the result of interpreting the object as an instance of '<em>Rule</em>'.
312:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
313:          * @generated
314:          */
315:         public T caseRule(Rule object) {
316:                 return null;
317:         }
318:
319:         /**
320:          * Returns the result of interpreting the object as an instance of '<em>Show Rule</em>'.
321:          * <!-- begin-user-doc -->
322:          * This implementation returns null;
323:          * returning a non-null result will terminate the switch.
324:          * <!-- end-user-doc -->
325:          *
326:          * @param object the target of the switch.
327:          * @return the result of interpreting the object as an instance of '<em>Show Rule</em>'.
328:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
329:          * @generated
330:          */
331:         public T caseShowRule(ShowRule object) {
332:                 return null;
333:         }
334:
335:         /**
336:          * Returns the result of interpreting the object as an instance of '<em>Enable Rule</em>'.
337:          * <!-- begin-user-doc -->
338:          * This implementation returns null;
339:          * returning a non-null result will terminate the switch.
340:          * <!-- end-user-doc -->
341:          *
342:          * @param object the target of the switch.
343:          * @return the result of interpreting the object as an instance of '<em>Enable Rule</em>'.
344:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
345:          * @generated
346:          */
347:         public T caseEnableRule(EnableRule object) {
348:                 return null;
349:         }
350:
351:         /**
352:          * Returns the result of interpreting the object as an instance of '<em>Iterate Condition</em>'.
353:          * <!-- begin-user-doc -->
354:          * This implementation returns null;
355:          * returning a non-null result will terminate the switch.
356:          * <!-- end-user-doc -->
357:          *
358:          * @param object the target of the switch.
359:          * @return the result of interpreting the object as an instance of '<em>Iterate Condition</em>'.
360:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
361:          * @generated
362:          */
363:         public T caseIterateCondition(IterateCondition object) {
364:                 return null;
365:         }
366:
367:         /**
368:          * Returns the result of interpreting the object as an instance of '<em>True</em>'.
369:          * <!-- begin-user-doc -->
370:          * This implementation returns null;
371:          * returning a non-null result will terminate the switch.
372:          * <!-- end-user-doc -->
373:          *
374:          * @param object the target of the switch.
375:          * @return the result of interpreting the object as an instance of '<em>True</em>'.
376:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
377:          * @generated
378:          */
379:         public T caseTrue(True object) {
380:                 return null;
381:         }
382:
383:         /**
384:          * Returns the result of interpreting the object as an instance of '<em>False</em>'.
385:          * <!-- begin-user-doc -->
386:          * This implementation returns null;
387:          * returning a non-null result will terminate the switch.
388:          * <!-- end-user-doc -->
389:          *
390:          * @param object the target of the switch.
391:          * @return the result of interpreting the object as an instance of '<em>False</em>'.
392:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
393:          * @generated
394:          */
395:         public T caseFalse(False object) {
396:                 return null;
397:         }
398:
399:         /**
400:          * Returns the result of interpreting the object as an instance of '<em>Not Condition</em>'.
401:          * <!-- begin-user-doc -->
402:          * This implementation returns null;
403:          * returning a non-null result will terminate the switch.
404:          * <!-- end-user-doc -->
405:          *
406:          * @param object the target of the switch.
407:          * @return the result of interpreting the object as an instance of '<em>Not Condition</em>'.
408:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
409:          * @generated
410:          */
411:         public T caseNotCondition(NotCondition object) {
412:                 return null;
413:         }
414:
415:         /**
416:          * Returns the result of interpreting the object as an instance of '<em>Is Proxy Condition</em>'.
417:          * <!-- begin-user-doc -->
418:          * This implementation returns null;
419:          * returning a non-null result will terminate the switch.
420:          * <!-- end-user-doc -->
421:          *
422:          * @param object the target of the switch.
423:          * @return the result of interpreting the object as an instance of '<em>Is Proxy Condition</em>'.
424:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
425:          * @generated
426:          */
427:         public T caseIsProxyCondition(IsProxyCondition object) {
428:                 return null;
429:         }
430:
431:         /**
432:          * Returns the result of interpreting the object as an instance of '<em>Attachment</em>'.
433:          * <!-- begin-user-doc -->
434:          * This implementation returns null;
435:          * returning a non-null result will terminate the switch.
436:          * <!-- end-user-doc -->
437:          *
438:          * @param object the target of the switch.
439:          * @return the result of interpreting the object as an instance of '<em>Attachment</em>'.
440:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
441:          * @generated
442:          */
443:         public T caseAttachment(VAttachment object) {
444:                 return null;
445:         }
446:
447:         /**
448:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
449:          * <!-- begin-user-doc -->
450:          * This implementation returns null;
451:          * returning a non-null result will terminate the switch, but this is the last case anyway.
452:          * <!-- end-user-doc -->
453:          *
454:          * @param object the target of the switch.
455:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
456:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
457:          * @generated
458:          */
459:         @Override
460:         public T defaultCase(EObject object) {
461:                 return null;
462:         }
463:
464: } // RuleSwitch