Skip to content

Package: DomainmodelreferenceSwitch

DomainmodelreferenceSwitch

nameinstructionbranchcomplexitylinemethod
DomainmodelreferenceSwitch()
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%
caseDomainModelReferenceSelector(VTDomainModelReferenceSelector)
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%
caseStyleSelector(VTStyleSelector)
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: 12 C: 15
56%
M: 3 C: 3
50%
M: 3 C: 1
25%
M: 3 C: 6
67%
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-2014 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 - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.template.selector.domainmodelreference.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.template.model.VTStyleSelector;
20: import org.eclipse.emf.ecp.view.template.selector.domainmodelreference.model.VTDomainModelReferenceSelector;
21: import org.eclipse.emf.ecp.view.template.selector.domainmodelreference.model.VTDomainmodelreferencePackage;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * The <b>Switch</b> for the model's inheritance hierarchy.
26: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
27: * class of the model,
28: * starting with the actual class of the object
29: * and proceeding up the inheritance hierarchy
30: * until a non-null result is returned,
31: * which is the result of the switch.
32: * <!-- end-user-doc -->
33: *
34: * @see org.eclipse.emf.ecp.view.template.selector.domainmodelreference.model.VTDomainmodelreferencePackage
35: * @generated
36: */
37: public class DomainmodelreferenceSwitch<T> extends Switch<T> {
38:         /**
39:          * The cached model package
40:          * <!-- begin-user-doc -->
41:          * <!-- end-user-doc -->
42:          *
43:          * @generated
44:          */
45:         protected static VTDomainmodelreferencePackage modelPackage;
46:
47:         /**
48:          * Creates an instance of the switch.
49:          * <!-- begin-user-doc -->
50:          * <!-- end-user-doc -->
51:          *
52:          * @generated
53:          */
54:         public DomainmodelreferenceSwitch() {
55:•                if (modelPackage == null) {
56:                         modelPackage = VTDomainmodelreferencePackage.eINSTANCE;
57:                 }
58:         }
59:
60:         /**
61:          * Checks whether this is a switch for the given package.
62:          * <!-- begin-user-doc -->
63:          * <!-- end-user-doc -->
64:          *
65:          * @param ePackage the package in question.
66:          * @return whether this is a switch for the given package.
67:          * @generated
68:          */
69:         @Override
70:         protected boolean isSwitchFor(EPackage ePackage) {
71:•                return ePackage == modelPackage;
72:         }
73:
74:         /**
75:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
76:          * result.
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @return the first non-null result returned by a <code>caseXXX</code> call.
81:          * @generated
82:          */
83:         @Override
84:         protected T doSwitch(int classifierID, EObject theEObject) {
85:•                switch (classifierID) {
86:                 case VTDomainmodelreferencePackage.DOMAIN_MODEL_REFERENCE_SELECTOR: {
87:                         final VTDomainModelReferenceSelector domainModelReferenceSelector = (VTDomainModelReferenceSelector) theEObject;
88:                         T result = caseDomainModelReferenceSelector(domainModelReferenceSelector);
89:•                        if (result == null) {
90:                                 result = caseStyleSelector(domainModelReferenceSelector);
91:                         }
92:•                        if (result == null) {
93:                                 result = defaultCase(theEObject);
94:                         }
95:                         return result;
96:                 }
97:                 default:
98:                         return defaultCase(theEObject);
99:                 }
100:         }
101:
102:         /**
103:          * Returns the result of interpreting the object as an instance of '<em>Domain Model Reference Selector</em>'.
104:          * <!-- begin-user-doc -->
105:          * This implementation returns null;
106:          * returning a non-null result will terminate the switch.
107:          * <!-- end-user-doc -->
108:          *
109:          * @param object the target of the switch.
110:          * @return the result of interpreting the object as an instance of '<em>Domain Model Reference Selector</em>'.
111:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
112:          * @generated
113:          */
114:         public T caseDomainModelReferenceSelector(VTDomainModelReferenceSelector object) {
115:                 return null;
116:         }
117:
118:         /**
119:          * Returns the result of interpreting the object as an instance of '<em>Style Selector</em>'.
120:          * <!-- begin-user-doc -->
121:          * This implementation returns null;
122:          * returning a non-null result will terminate the switch.
123:          * <!-- end-user-doc -->
124:          *
125:          * @param object the target of the switch.
126:          * @return the result of interpreting the object as an instance of '<em>Style Selector</em>'.
127:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
128:          * @generated
129:          */
130:         public T caseStyleSelector(VTStyleSelector object) {
131:                 return null;
132:         }
133:
134:         /**
135:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
136:          * <!-- begin-user-doc -->
137:          * This implementation returns null;
138:          * returning a non-null result will terminate the switch, but this is the last case anyway.
139:          * <!-- end-user-doc -->
140:          *
141:          * @param object the target of the switch.
142:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
143:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
144:          * @generated
145:          */
146:         @Override
147:         public T defaultCase(EObject object) {
148:                 return null;
149:         }
150:
151: } // DomainmodelreferenceSwitch