1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.util; |
8 | |
9 | import de.uka.ipd.sdq.pcm.core.entity.NamedElement; |
10 | |
11 | import de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.*; |
12 | |
13 | import java.util.List; |
14 | |
15 | import org.eclipse.emf.ecore.EClass; |
16 | import org.eclipse.emf.ecore.EObject; |
17 | |
18 | /** |
19 | * <!-- begin-user-doc --> |
20 | * The <b>Switch</b> for the model's inheritance hierarchy. |
21 | * It supports the call {@link #doSwitch(EObject) doSwitch(object)} |
22 | * to invoke the <code>caseXXX</code> method for each class of the model, |
23 | * starting with the actual class of the object |
24 | * and proceeding up the inheritance hierarchy |
25 | * until a non-null result is returned, |
26 | * which is the result of the switch. |
27 | * <!-- end-user-doc --> |
28 | * @see de.uka.ipd.sdq.pcm.resultdecorator.resourceenvironmentdecorator.ResourceenvironmentdecoratorPackage |
29 | * @generated |
30 | */ |
31 | public class ResourceenvironmentdecoratorSwitch<T> { |
32 | /** |
33 | * The cached model package |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | protected static ResourceenvironmentdecoratorPackage modelPackage; |
39 | |
40 | /** |
41 | * Creates an instance of the switch. |
42 | * <!-- begin-user-doc --> |
43 | * <!-- end-user-doc --> |
44 | * @generated |
45 | */ |
46 | public ResourceenvironmentdecoratorSwitch() { |
47 | if (modelPackage == null) { |
48 | modelPackage = ResourceenvironmentdecoratorPackage.eINSTANCE; |
49 | } |
50 | } |
51 | |
52 | /** |
53 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
54 | * <!-- begin-user-doc --> |
55 | * <!-- end-user-doc --> |
56 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
57 | * @generated |
58 | */ |
59 | public T doSwitch(EObject theEObject) { |
60 | return doSwitch(theEObject.eClass(), theEObject); |
61 | } |
62 | |
63 | /** |
64 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
65 | * <!-- begin-user-doc --> |
66 | * <!-- end-user-doc --> |
67 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
68 | * @generated |
69 | */ |
70 | protected T doSwitch(EClass theEClass, EObject theEObject) { |
71 | if (theEClass.eContainer() == modelPackage) { |
72 | return doSwitch(theEClass.getClassifierID(), theEObject); |
73 | } |
74 | else { |
75 | List<EClass> eSuperTypes = theEClass.getESuperTypes(); |
76 | return |
77 | eSuperTypes.isEmpty() ? |
78 | defaultCase(theEObject) : |
79 | doSwitch(eSuperTypes.get(0), theEObject); |
80 | } |
81 | } |
82 | |
83 | /** |
84 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
85 | * <!-- begin-user-doc --> |
86 | * <!-- end-user-doc --> |
87 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
88 | * @generated |
89 | */ |
90 | protected T doSwitch(int classifierID, EObject theEObject) { |
91 | switch (classifierID) { |
92 | case ResourceenvironmentdecoratorPackage.LINKING_RESOURCE_RESULTS: { |
93 | LinkingResourceResults linkingResourceResults = (LinkingResourceResults)theEObject; |
94 | T result = caseLinkingResourceResults(linkingResourceResults); |
95 | if (result == null) result = caseActiveResourceUtilisationResult(linkingResourceResults); |
96 | if (result == null) result = caseUtilisationResult(linkingResourceResults); |
97 | if (result == null) result = caseNamedElement(linkingResourceResults); |
98 | if (result == null) result = defaultCase(theEObject); |
99 | return result; |
100 | } |
101 | case ResourceenvironmentdecoratorPackage.ACTIVE_RESOURCE_UTILISATION_RESULT: { |
102 | ActiveResourceUtilisationResult activeResourceUtilisationResult = (ActiveResourceUtilisationResult)theEObject; |
103 | T result = caseActiveResourceUtilisationResult(activeResourceUtilisationResult); |
104 | if (result == null) result = caseUtilisationResult(activeResourceUtilisationResult); |
105 | if (result == null) result = caseNamedElement(activeResourceUtilisationResult); |
106 | if (result == null) result = defaultCase(theEObject); |
107 | return result; |
108 | } |
109 | case ResourceenvironmentdecoratorPackage.UTILISATION_RESULT: { |
110 | UtilisationResult utilisationResult = (UtilisationResult)theEObject; |
111 | T result = caseUtilisationResult(utilisationResult); |
112 | if (result == null) result = caseNamedElement(utilisationResult); |
113 | if (result == null) result = defaultCase(theEObject); |
114 | return result; |
115 | } |
116 | case ResourceenvironmentdecoratorPackage.RESOURCE_CONTAINER_RESULTS: { |
117 | ResourceContainerResults resourceContainerResults = (ResourceContainerResults)theEObject; |
118 | T result = caseResourceContainerResults(resourceContainerResults); |
119 | if (result == null) result = caseActiveResourceUtilisationResult(resourceContainerResults); |
120 | if (result == null) result = caseUtilisationResult(resourceContainerResults); |
121 | if (result == null) result = caseNamedElement(resourceContainerResults); |
122 | if (result == null) result = defaultCase(theEObject); |
123 | return result; |
124 | } |
125 | case ResourceenvironmentdecoratorPackage.PROCESSING_RESOURCE_SPECIFICATION_RESULT: { |
126 | ProcessingResourceSpecificationResult processingResourceSpecificationResult = (ProcessingResourceSpecificationResult)theEObject; |
127 | T result = caseProcessingResourceSpecificationResult(processingResourceSpecificationResult); |
128 | if (result == null) result = caseActiveResourceUtilisationResult(processingResourceSpecificationResult); |
129 | if (result == null) result = caseUtilisationResult(processingResourceSpecificationResult); |
130 | if (result == null) result = caseNamedElement(processingResourceSpecificationResult); |
131 | if (result == null) result = defaultCase(theEObject); |
132 | return result; |
133 | } |
134 | case ResourceenvironmentdecoratorPackage.PASSIVE_RESOURCE_RESULT: { |
135 | PassiveResourceResult passiveResourceResult = (PassiveResourceResult)theEObject; |
136 | T result = casePassiveResourceResult(passiveResourceResult); |
137 | if (result == null) result = caseUtilisationResult(passiveResourceResult); |
138 | if (result == null) result = caseNamedElement(passiveResourceResult); |
139 | if (result == null) result = defaultCase(theEObject); |
140 | return result; |
141 | } |
142 | default: return defaultCase(theEObject); |
143 | } |
144 | } |
145 | |
146 | /** |
147 | * Returns the result of interpreting the object as an instance of '<em>Linking Resource Results</em>'. |
148 | * <!-- begin-user-doc --> |
149 | * This implementation returns null; |
150 | * returning a non-null result will terminate the switch. |
151 | * <!-- end-user-doc --> |
152 | * @param object the target of the switch. |
153 | * @return the result of interpreting the object as an instance of '<em>Linking Resource Results</em>'. |
154 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
155 | * @generated |
156 | */ |
157 | public T caseLinkingResourceResults(LinkingResourceResults object) { |
158 | return null; |
159 | } |
160 | |
161 | /** |
162 | * Returns the result of interpreting the object as an instance of '<em>Active Resource Utilisation Result</em>'. |
163 | * <!-- begin-user-doc --> |
164 | * This implementation returns null; |
165 | * returning a non-null result will terminate the switch. |
166 | * <!-- end-user-doc --> |
167 | * @param object the target of the switch. |
168 | * @return the result of interpreting the object as an instance of '<em>Active Resource Utilisation Result</em>'. |
169 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
170 | * @generated |
171 | */ |
172 | public T caseActiveResourceUtilisationResult(ActiveResourceUtilisationResult object) { |
173 | return null; |
174 | } |
175 | |
176 | /** |
177 | * Returns the result of interpreting the object as an instance of '<em>Utilisation Result</em>'. |
178 | * <!-- begin-user-doc --> |
179 | * This implementation returns null; |
180 | * returning a non-null result will terminate the switch. |
181 | * <!-- end-user-doc --> |
182 | * @param object the target of the switch. |
183 | * @return the result of interpreting the object as an instance of '<em>Utilisation Result</em>'. |
184 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
185 | * @generated |
186 | */ |
187 | public T caseUtilisationResult(UtilisationResult object) { |
188 | return null; |
189 | } |
190 | |
191 | /** |
192 | * Returns the result of interpreting the object as an instance of '<em>Resource Container Results</em>'. |
193 | * <!-- begin-user-doc --> |
194 | * This implementation returns null; |
195 | * returning a non-null result will terminate the switch. |
196 | * <!-- end-user-doc --> |
197 | * @param object the target of the switch. |
198 | * @return the result of interpreting the object as an instance of '<em>Resource Container Results</em>'. |
199 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
200 | * @generated |
201 | */ |
202 | public T caseResourceContainerResults(ResourceContainerResults object) { |
203 | return null; |
204 | } |
205 | |
206 | /** |
207 | * Returns the result of interpreting the object as an instance of '<em>Processing Resource Specification Result</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 | * @param object the target of the switch. |
213 | * @return the result of interpreting the object as an instance of '<em>Processing Resource Specification Result</em>'. |
214 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
215 | * @generated |
216 | */ |
217 | public T caseProcessingResourceSpecificationResult(ProcessingResourceSpecificationResult object) { |
218 | return null; |
219 | } |
220 | |
221 | /** |
222 | * Returns the result of interpreting the object as an instance of '<em>Passive Resource Result</em>'. |
223 | * <!-- begin-user-doc --> |
224 | * This implementation returns null; |
225 | * returning a non-null result will terminate the switch. |
226 | * <!-- end-user-doc --> |
227 | * @param object the target of the switch. |
228 | * @return the result of interpreting the object as an instance of '<em>Passive Resource Result</em>'. |
229 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
230 | * @generated |
231 | */ |
232 | public T casePassiveResourceResult(PassiveResourceResult object) { |
233 | return null; |
234 | } |
235 | |
236 | /** |
237 | * Returns the result of interpreting the object as an instance of '<em>Named Element</em>'. |
238 | * <!-- begin-user-doc --> |
239 | * This implementation returns null; |
240 | * returning a non-null result will terminate the switch. |
241 | * <!-- end-user-doc --> |
242 | * @param object the target of the switch. |
243 | * @return the result of interpreting the object as an instance of '<em>Named Element</em>'. |
244 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
245 | * @generated |
246 | */ |
247 | public T caseNamedElement(NamedElement object) { |
248 | return null; |
249 | } |
250 | |
251 | /** |
252 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. |
253 | * <!-- begin-user-doc --> |
254 | * This implementation returns null; |
255 | * returning a non-null result will terminate the switch, but this is the last case anyway. |
256 | * <!-- end-user-doc --> |
257 | * @param object the target of the switch. |
258 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. |
259 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) |
260 | * @generated |
261 | */ |
262 | public T defaultCase(EObject object) { |
263 | return null; |
264 | } |
265 | |
266 | } //ResourceenvironmentdecoratorSwitch |