Skip to content

Package: UniversitySwitch

UniversitySwitch

nameinstructionbranchcomplexitylinemethod
UniversitySwitch()
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%
caseAddress(Address)
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%
caseAssistant(Assistant)
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%
caseCourse(Course)
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%
caseCourseCatalog(CourseCatalog)
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%
casePerson(Person)
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%
caseProfessor(Professor)
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%
caseStaff(Staff)
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: 123 C: 0
0%
M: 26 C: 0
0%
M: 17 C: 0
0%
M: 41 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 - Generated code
13: */
14: package org.eclipse.emf.ecp.test.university.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.test.university.Address;
20: import org.eclipse.emf.ecp.test.university.Assistant;
21: import org.eclipse.emf.ecp.test.university.Course;
22: import org.eclipse.emf.ecp.test.university.CourseCatalog;
23: import org.eclipse.emf.ecp.test.university.Person;
24: import org.eclipse.emf.ecp.test.university.Professor;
25: import org.eclipse.emf.ecp.test.university.Staff;
26: import org.eclipse.emf.ecp.test.university.UniversityPackage;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * The <b>Switch</b> for the model's inheritance hierarchy.
31: * It supports the call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each
32: * class of the model,
33: * starting with the actual class of the object
34: * and proceeding up the inheritance hierarchy
35: * until a non-null result is returned,
36: * which is the result of the switch.
37: * <!-- end-user-doc -->
38: *
39: * @see org.eclipse.emf.ecp.test.university.UniversityPackage
40: * @generated
41: */
42: public class UniversitySwitch<T> extends Switch<T> {
43:         /**
44:          * The cached model package
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         protected static UniversityPackage modelPackage;
51:
52:         /**
53:          * Creates an instance of the switch.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @generated
58:          */
59:         public UniversitySwitch() {
60:•                if (modelPackage == null) {
61:                         modelPackage = UniversityPackage.eINSTANCE;
62:                 }
63:         }
64:
65:         /**
66:          * Checks whether this is a switch for the given package.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @param ePackage the package in question.
71:          * @return whether this is a switch for the given package.
72:          * @generated
73:          */
74:         @Override
75:         protected boolean isSwitchFor(EPackage ePackage) {
76:•                return ePackage == modelPackage;
77:         }
78:
79:         /**
80:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
81:          * result.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @return the first non-null result returned by a <code>caseXXX</code> call.
86:          * @generated
87:          */
88:         @Override
89:         protected T doSwitch(int classifierID, EObject theEObject) {
90:•                switch (classifierID) {
91:                 case UniversityPackage.COURSE_CATALOG: {
92:                         final CourseCatalog courseCatalog = (CourseCatalog) theEObject;
93:                         T result = caseCourseCatalog(courseCatalog);
94:•                        if (result == null) {
95:                                 result = defaultCase(theEObject);
96:                         }
97:                         return result;
98:                 }
99:                 case UniversityPackage.COURSE: {
100:                         final Course course = (Course) theEObject;
101:                         T result = caseCourse(course);
102:•                        if (result == null) {
103:                                 result = defaultCase(theEObject);
104:                         }
105:                         return result;
106:                 }
107:                 case UniversityPackage.STAFF: {
108:                         final Staff staff = (Staff) theEObject;
109:                         T result = caseStaff(staff);
110:•                        if (result == null) {
111:                                 result = defaultCase(theEObject);
112:                         }
113:                         return result;
114:                 }
115:                 case UniversityPackage.PROFESSOR: {
116:                         final Professor professor = (Professor) theEObject;
117:                         T result = caseProfessor(professor);
118:•                        if (result == null) {
119:                                 result = casePerson(professor);
120:                         }
121:•                        if (result == null) {
122:                                 result = defaultCase(theEObject);
123:                         }
124:                         return result;
125:                 }
126:                 case UniversityPackage.ASSISTANT: {
127:                         final Assistant assistant = (Assistant) theEObject;
128:                         T result = caseAssistant(assistant);
129:•                        if (result == null) {
130:                                 result = casePerson(assistant);
131:                         }
132:•                        if (result == null) {
133:                                 result = defaultCase(theEObject);
134:                         }
135:                         return result;
136:                 }
137:                 case UniversityPackage.PERSON: {
138:                         final Person person = (Person) theEObject;
139:                         T result = casePerson(person);
140:•                        if (result == null) {
141:                                 result = defaultCase(theEObject);
142:                         }
143:                         return result;
144:                 }
145:                 case UniversityPackage.ADDRESS: {
146:                         final Address address = (Address) theEObject;
147:                         T result = caseAddress(address);
148:•                        if (result == null) {
149:                                 result = defaultCase(theEObject);
150:                         }
151:                         return result;
152:                 }
153:                 default:
154:                         return defaultCase(theEObject);
155:                 }
156:         }
157:
158:         /**
159:          * Returns the result of interpreting the object as an instance of '<em>Course Catalog</em>'.
160:          * <!-- begin-user-doc -->
161:          * This implementation returns null;
162:          * returning a non-null result will terminate the switch.
163:          * <!-- end-user-doc -->
164:          *
165:          * @param object the target of the switch.
166:          * @return the result of interpreting the object as an instance of '<em>Course Catalog</em>'.
167:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
168:          * @generated
169:          */
170:         public T caseCourseCatalog(CourseCatalog object) {
171:                 return null;
172:         }
173:
174:         /**
175:          * Returns the result of interpreting the object as an instance of '<em>Course</em>'.
176:          * <!-- begin-user-doc -->
177:          * This implementation returns null;
178:          * returning a non-null result will terminate the switch.
179:          * <!-- end-user-doc -->
180:          *
181:          * @param object the target of the switch.
182:          * @return the result of interpreting the object as an instance of '<em>Course</em>'.
183:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
184:          * @generated
185:          */
186:         public T caseCourse(Course object) {
187:                 return null;
188:         }
189:
190:         /**
191:          * Returns the result of interpreting the object as an instance of '<em>Staff</em>'.
192:          * <!-- begin-user-doc -->
193:          * This implementation returns null;
194:          * returning a non-null result will terminate the switch.
195:          * <!-- end-user-doc -->
196:          *
197:          * @param object the target of the switch.
198:          * @return the result of interpreting the object as an instance of '<em>Staff</em>'.
199:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
200:          * @generated
201:          */
202:         public T caseStaff(Staff object) {
203:                 return null;
204:         }
205:
206:         /**
207:          * Returns the result of interpreting the object as an instance of '<em>Professor</em>'.
208:          * <!-- begin-user-doc -->
209:          * This implementation returns null;
210:          * returning a non-null result will terminate the switch.
211:          * <!-- end-user-doc -->
212:          *
213:          * @param object the target of the switch.
214:          * @return the result of interpreting the object as an instance of '<em>Professor</em>'.
215:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
216:          * @generated
217:          */
218:         public T caseProfessor(Professor object) {
219:                 return null;
220:         }
221:
222:         /**
223:          * Returns the result of interpreting the object as an instance of '<em>Assistant</em>'.
224:          * <!-- begin-user-doc -->
225:          * This implementation returns null;
226:          * returning a non-null result will terminate the switch.
227:          * <!-- end-user-doc -->
228:          *
229:          * @param object the target of the switch.
230:          * @return the result of interpreting the object as an instance of '<em>Assistant</em>'.
231:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
232:          * @generated
233:          */
234:         public T caseAssistant(Assistant object) {
235:                 return null;
236:         }
237:
238:         /**
239:          * Returns the result of interpreting the object as an instance of '<em>Person</em>'.
240:          * <!-- begin-user-doc -->
241:          * This implementation returns null;
242:          * returning a non-null result will terminate the switch.
243:          * <!-- end-user-doc -->
244:          *
245:          * @param object the target of the switch.
246:          * @return the result of interpreting the object as an instance of '<em>Person</em>'.
247:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
248:          * @generated
249:          */
250:         public T casePerson(Person object) {
251:                 return null;
252:         }
253:
254:         /**
255:          * Returns the result of interpreting the object as an instance of '<em>Address</em>'.
256:          * <!-- begin-user-doc -->
257:          * This implementation returns null;
258:          * returning a non-null result will terminate the switch.
259:          * <!-- end-user-doc -->
260:          *
261:          * @param object the target of the switch.
262:          * @return the result of interpreting the object as an instance of '<em>Address</em>'.
263:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
264:          * @generated
265:          */
266:         public T caseAddress(Address object) {
267:                 return null;
268:         }
269:
270:         /**
271:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
272:          * <!-- begin-user-doc -->
273:          * This implementation returns null;
274:          * returning a non-null result will terminate the switch, but this is the last case anyway.
275:          * <!-- end-user-doc -->
276:          *
277:          * @param object the target of the switch.
278:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
279:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
280:          * @generated
281:          */
282:         @Override
283:         public T defaultCase(EObject object) {
284:                 return null;
285:         }
286:
287: } // UniversitySwitch