1 | /** |
2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.pcm.seff.seff_reliability.util; |
7 | |
8 | import java.util.List; |
9 | |
10 | import org.eclipse.emf.ecore.EClass; |
11 | import org.eclipse.emf.ecore.EObject; |
12 | |
13 | import de.uka.ipd.sdq.identifier.Identifier; |
14 | import de.uka.ipd.sdq.pcm.core.entity.Entity; |
15 | import de.uka.ipd.sdq.pcm.core.entity.NamedElement; |
16 | import de.uka.ipd.sdq.pcm.seff.AbstractAction; |
17 | import de.uka.ipd.sdq.pcm.seff.AbstractInternalControlFlowAction; |
18 | import de.uka.ipd.sdq.pcm.seff.ResourceDemandingBehaviour; |
19 | import de.uka.ipd.sdq.pcm.seff.seff_reliability.*; |
20 | import de.uka.ipd.sdq.pcm.seff.seff_reliability.FailureHandlingEntity; |
21 | import de.uka.ipd.sdq.pcm.seff.seff_reliability.Seff_reliabilityPackage; |
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)} |
27 | * to invoke the <code>caseXXX</code> method for each 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 | * @see de.uka.ipd.sdq.pcm.seff.seff_reliability.Seff_reliabilityPackage |
34 | * @generated |
35 | */ |
36 | public class Seff_reliabilitySwitch<T> { |
37 | /** |
38 | * <!-- begin-user-doc --> |
39 | * <!-- end-user-doc --> |
40 | * @generated |
41 | */ |
42 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
43 | |
44 | /** |
45 | * The cached model package |
46 | * <!-- begin-user-doc --> |
47 | * <!-- end-user-doc --> |
48 | * @generated |
49 | */ |
50 | protected static Seff_reliabilityPackage modelPackage; |
51 | |
52 | /** |
53 | * Creates an instance of the switch. |
54 | * <!-- begin-user-doc --> |
55 | * <!-- end-user-doc --> |
56 | * @generated |
57 | */ |
58 | public Seff_reliabilitySwitch() { |
59 | if (modelPackage == null) { |
60 | modelPackage = Seff_reliabilityPackage.eINSTANCE; |
61 | } |
62 | } |
63 | |
64 | /** |
65 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
66 | * <!-- begin-user-doc --> |
67 | * <!-- end-user-doc --> |
68 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
69 | * @generated |
70 | */ |
71 | public T doSwitch(EObject theEObject) { |
72 | return doSwitch(theEObject.eClass(), theEObject); |
73 | } |
74 | |
75 | /** |
76 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
77 | * <!-- begin-user-doc --> |
78 | * <!-- end-user-doc --> |
79 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
80 | * @generated |
81 | */ |
82 | protected T doSwitch(EClass theEClass, EObject theEObject) { |
83 | if (theEClass.eContainer() == modelPackage) { |
84 | return doSwitch(theEClass.getClassifierID(), theEObject); |
85 | } |
86 | else { |
87 | List<EClass> eSuperTypes = theEClass.getESuperTypes(); |
88 | return |
89 | eSuperTypes.isEmpty() ? |
90 | defaultCase(theEObject) : |
91 | doSwitch(eSuperTypes.get(0), theEObject); |
92 | } |
93 | } |
94 | |
95 | /** |
96 | * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. |
97 | * <!-- begin-user-doc --> |
98 | * <!-- end-user-doc --> |
99 | * @return the first non-null result returned by a <code>caseXXX</code> call. |
100 | * @generated |
101 | */ |
102 | protected T doSwitch(int classifierID, EObject theEObject) { |
103 | switch (classifierID) { |
104 | case Seff_reliabilityPackage.RECOVERY_ACTION_BEHAVIOUR: { |
105 | RecoveryActionBehaviour recoveryActionBehaviour = (RecoveryActionBehaviour)theEObject; |
106 | T result = caseRecoveryActionBehaviour(recoveryActionBehaviour); |
107 | if (result == null) result = caseFailureHandlingEntity(recoveryActionBehaviour); |
108 | if (result == null) result = caseResourceDemandingBehaviour(recoveryActionBehaviour); |
109 | if (result == null) result = caseEntity(recoveryActionBehaviour); |
110 | if (result == null) result = caseIdentifier(recoveryActionBehaviour); |
111 | if (result == null) result = caseNamedElement(recoveryActionBehaviour); |
112 | if (result == null) result = defaultCase(theEObject); |
113 | return result; |
114 | } |
115 | case Seff_reliabilityPackage.RECOVERY_ACTION: { |
116 | RecoveryAction recoveryAction = (RecoveryAction)theEObject; |
117 | T result = caseRecoveryAction(recoveryAction); |
118 | if (result == null) result = caseAbstractInternalControlFlowAction(recoveryAction); |
119 | if (result == null) result = caseAbstractAction(recoveryAction); |
120 | if (result == null) result = caseEntity(recoveryAction); |
121 | if (result == null) result = caseIdentifier(recoveryAction); |
122 | if (result == null) result = caseNamedElement(recoveryAction); |
123 | if (result == null) result = defaultCase(theEObject); |
124 | return result; |
125 | } |
126 | case Seff_reliabilityPackage.FAILURE_HANDLING_ENTITY: { |
127 | FailureHandlingEntity failureHandlingEntity = (FailureHandlingEntity)theEObject; |
128 | T result = caseFailureHandlingEntity(failureHandlingEntity); |
129 | if (result == null) result = caseEntity(failureHandlingEntity); |
130 | if (result == null) result = caseIdentifier(failureHandlingEntity); |
131 | if (result == null) result = caseNamedElement(failureHandlingEntity); |
132 | if (result == null) result = defaultCase(theEObject); |
133 | return result; |
134 | } |
135 | default: return defaultCase(theEObject); |
136 | } |
137 | } |
138 | |
139 | /** |
140 | * Returns the result of interpreting the object as an instance of '<em>Recovery Action Behaviour</em>'. |
141 | * <!-- begin-user-doc --> |
142 | * This implementation returns null; |
143 | * returning a non-null result will terminate the switch. |
144 | * <!-- end-user-doc --> |
145 | * @param object the target of the switch. |
146 | * @return the result of interpreting the object as an instance of '<em>Recovery Action Behaviour</em>'. |
147 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
148 | * @generated |
149 | */ |
150 | public T caseRecoveryActionBehaviour(RecoveryActionBehaviour object) { |
151 | return null; |
152 | } |
153 | |
154 | /** |
155 | * Returns the result of interpreting the object as an instance of '<em>Recovery Action</em>'. |
156 | * <!-- begin-user-doc --> |
157 | * This implementation returns null; |
158 | * returning a non-null result will terminate the switch. |
159 | * <!-- end-user-doc --> |
160 | * @param object the target of the switch. |
161 | * @return the result of interpreting the object as an instance of '<em>Recovery Action</em>'. |
162 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
163 | * @generated |
164 | */ |
165 | public T caseRecoveryAction(RecoveryAction object) { |
166 | return null; |
167 | } |
168 | |
169 | /** |
170 | * Returns the result of interpreting the object as an instance of '<em>Failure Handling Entity</em>'. |
171 | * <!-- begin-user-doc --> |
172 | * This implementation returns null; |
173 | * returning a non-null result will terminate the switch. |
174 | * <!-- end-user-doc --> |
175 | * @param object the target of the switch. |
176 | * @return the result of interpreting the object as an instance of '<em>Failure Handling Entity</em>'. |
177 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
178 | * @generated |
179 | */ |
180 | public T caseFailureHandlingEntity(FailureHandlingEntity object) { |
181 | return null; |
182 | } |
183 | |
184 | /** |
185 | * Returns the result of interpreting the object as an instance of '<em>Identifier</em>'. |
186 | * <!-- begin-user-doc --> |
187 | * This implementation returns null; |
188 | * returning a non-null result will terminate the switch. |
189 | * <!-- end-user-doc --> |
190 | * @param object the target of the switch. |
191 | * @return the result of interpreting the object as an instance of '<em>Identifier</em>'. |
192 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
193 | * @generated |
194 | */ |
195 | public T caseIdentifier(Identifier object) { |
196 | return null; |
197 | } |
198 | |
199 | /** |
200 | * Returns the result of interpreting the object as an instance of '<em>Named Element</em>'. |
201 | * <!-- begin-user-doc --> |
202 | * This implementation returns null; |
203 | * returning a non-null result will terminate the switch. |
204 | * <!-- end-user-doc --> |
205 | * @param object the target of the switch. |
206 | * @return the result of interpreting the object as an instance of '<em>Named Element</em>'. |
207 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
208 | * @generated |
209 | */ |
210 | public T caseNamedElement(NamedElement object) { |
211 | return null; |
212 | } |
213 | |
214 | /** |
215 | * Returns the result of interpreting the object as an instance of '<em>Entity</em>'. |
216 | * <!-- begin-user-doc --> |
217 | * This implementation returns null; |
218 | * returning a non-null result will terminate the switch. |
219 | * <!-- end-user-doc --> |
220 | * @param object the target of the switch. |
221 | * @return the result of interpreting the object as an instance of '<em>Entity</em>'. |
222 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
223 | * @generated |
224 | */ |
225 | public T caseEntity(Entity object) { |
226 | return null; |
227 | } |
228 | |
229 | /** |
230 | * Returns the result of interpreting the object as an instance of '<em>Resource Demanding Behaviour</em>'. |
231 | * <!-- begin-user-doc --> |
232 | * This implementation returns null; |
233 | * returning a non-null result will terminate the switch. |
234 | * <!-- end-user-doc --> |
235 | * @param object the target of the switch. |
236 | * @return the result of interpreting the object as an instance of '<em>Resource Demanding Behaviour</em>'. |
237 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
238 | * @generated |
239 | */ |
240 | public T caseResourceDemandingBehaviour(ResourceDemandingBehaviour object) { |
241 | return null; |
242 | } |
243 | |
244 | /** |
245 | * Returns the result of interpreting the object as an instance of '<em>Abstract Action</em>'. |
246 | * <!-- begin-user-doc --> |
247 | * This implementation returns null; |
248 | * returning a non-null result will terminate the switch. |
249 | * <!-- end-user-doc --> |
250 | * @param object the target of the switch. |
251 | * @return the result of interpreting the object as an instance of '<em>Abstract Action</em>'. |
252 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
253 | * @generated |
254 | */ |
255 | public T caseAbstractAction(AbstractAction object) { |
256 | return null; |
257 | } |
258 | |
259 | /** |
260 | * Returns the result of interpreting the object as an instance of '<em>Abstract Internal Control Flow Action</em>'. |
261 | * <!-- begin-user-doc --> |
262 | * This implementation returns null; |
263 | * returning a non-null result will terminate the switch. |
264 | * <!-- end-user-doc --> |
265 | * @param object the target of the switch. |
266 | * @return the result of interpreting the object as an instance of '<em>Abstract Internal Control Flow Action</em>'. |
267 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
268 | * @generated |
269 | */ |
270 | public T caseAbstractInternalControlFlowAction(AbstractInternalControlFlowAction object) { |
271 | return null; |
272 | } |
273 | |
274 | /** |
275 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. |
276 | * <!-- begin-user-doc --> |
277 | * This implementation returns null; |
278 | * returning a non-null result will terminate the switch, but this is the last case anyway. |
279 | * <!-- end-user-doc --> |
280 | * @param object the target of the switch. |
281 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. |
282 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) |
283 | * @generated |
284 | */ |
285 | public T defaultCase(EObject object) { |
286 | return null; |
287 | } |
288 | |
289 | } //Seff_reliabilitySwitch |