Skip to content

Package: TaskSwitch

TaskSwitch

nameinstructionbranchcomplexitylinemethod
TaskSwitch()
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%
caseTask(Task)
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%
caseUser(User)
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%
caseUserGroup(UserGroup)
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: 51 C: 0
0%
M: 10 C: 0
0%
M: 7 C: 0
0%
M: 17 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-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.makeithappen.model.task.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.makeithappen.model.task.Task;
20: import org.eclipse.emf.ecp.makeithappen.model.task.TaskPackage;
21: import org.eclipse.emf.ecp.makeithappen.model.task.User;
22: import org.eclipse.emf.ecp.makeithappen.model.task.UserGroup;
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.makeithappen.model.task.TaskPackage
36: * @generated
37: */
38: public class TaskSwitch<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 TaskPackage modelPackage;
47:
48:         /**
49:          * Creates an instance of the switch.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @generated
54:          */
55:         public TaskSwitch() {
56:•                if (modelPackage == null) {
57:                         modelPackage = TaskPackage.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 TaskPackage.TASK: {
88:                         final Task task = (Task) theEObject;
89:•                        T result = caseTask(task);
90:                         if (result == null) {
91:                                 result = defaultCase(theEObject);
92:                         }
93:                         return result;
94:•                }
95:                 case TaskPackage.USER: {
96:                         final User user = (User) theEObject;
97:                         T result = caseUser(user);
98:                         if (result == null) {
99:                                 result = defaultCase(theEObject);
100:                         }
101:                         return result;
102:•                }
103:                 case TaskPackage.USER_GROUP: {
104:                         final UserGroup userGroup = (UserGroup) theEObject;
105:                         T result = caseUserGroup(userGroup);
106:                         if (result == null) {
107:                                 result = defaultCase(theEObject);
108:                         }
109:                         return result;
110:•                }
111:                 default:
112:                         return defaultCase(theEObject);
113:                 }
114:         }
115:
116:         /**
117:          * Returns the result of interpreting the object as an instance of '<em>Task</em>'.
118:          * <!-- begin-user-doc -->
119:          * This implementation returns null;
120:          * returning a non-null result will terminate the switch.
121:          * <!-- end-user-doc -->
122:          *
123:          * @param object the target of the switch.
124:          * @return the result of interpreting the object as an instance of '<em>Task</em>'.
125:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
126:          * @generated
127:          */
128:         public T caseTask(Task object) {
129:                 return null;
130:         }
131:
132:         /**
133:          * Returns the result of interpreting the object as an instance of '<em>User</em>'.
134:          * <!-- begin-user-doc -->
135:          * This implementation returns null;
136:          * returning a non-null result will terminate the switch.
137:          * <!-- end-user-doc -->
138:          *
139:          * @param object the target of the switch.
140:          * @return the result of interpreting the object as an instance of '<em>User</em>'.
141:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
142:          * @generated
143:          */
144:         public T caseUser(User object) {
145:                 return null;
146:         }
147:
148:         /**
149:          * Returns the result of interpreting the object as an instance of '<em>User Group</em>'.
150:          * <!-- begin-user-doc -->
151:          * This implementation returns null;
152:          * returning a non-null result will terminate the switch.
153:          * <!-- end-user-doc -->
154:          *
155:          * @param object the target of the switch.
156:          * @return the result of interpreting the object as an instance of '<em>User Group</em>'.
157:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
158:          * @generated
159:          */
160:         public T caseUserGroup(UserGroup object) {
161:                 return null;
162:         }
163:
164:         /**
165:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
166:          * <!-- begin-user-doc -->
167:          * This implementation returns null;
168:          * returning a non-null result will terminate the switch, but this is the last case anyway.
169:          * <!-- end-user-doc -->
170:          *
171:          * @param object the target of the switch.
172:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
173:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
174:          * @generated
175:          */
176:         @Override
177:         public T defaultCase(EObject object) {
178:                 return null;
179:         }
180:
181: } // TaskSwitch