Skip to content

Package: ViewproxySwitch

ViewproxySwitch

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