| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package de.uka.ipd.sdq.pipesandfilters.util; |
| 8 | |
| 9 | import de.uka.ipd.sdq.identifier.Identifier; |
| 10 | |
| 11 | import de.uka.ipd.sdq.pipesandfilters.*; |
| 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.pipesandfilters.pipesandfiltersPackage |
| 29 | * @generated |
| 30 | */ |
| 31 | public class pipesandfiltersSwitch<T> { |
| 32 | /** |
| 33 | * The cached model package |
| 34 | * <!-- begin-user-doc --> |
| 35 | * <!-- end-user-doc --> |
| 36 | * @generated |
| 37 | */ |
| 38 | protected static pipesandfiltersPackage modelPackage; |
| 39 | |
| 40 | /** |
| 41 | * Creates an instance of the switch. |
| 42 | * <!-- begin-user-doc --> |
| 43 | * <!-- end-user-doc --> |
| 44 | * @generated |
| 45 | */ |
| 46 | public pipesandfiltersSwitch() { |
| 47 | if (modelPackage == null) { |
| 48 | modelPackage = pipesandfiltersPackage.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 pipesandfiltersPackage.PIPE_ELEMENT: { |
| 93 | PipeElement pipeElement = (PipeElement)theEObject; |
| 94 | T result = casePipeElement(pipeElement); |
| 95 | if (result == null) result = caseIdentifier(pipeElement); |
| 96 | if (result == null) result = defaultCase(theEObject); |
| 97 | return result; |
| 98 | } |
| 99 | case pipesandfiltersPackage.FILTER: { |
| 100 | Filter filter = (Filter)theEObject; |
| 101 | T result = caseFilter(filter); |
| 102 | if (result == null) result = casePipeElement(filter); |
| 103 | if (result == null) result = caseIdentifier(filter); |
| 104 | if (result == null) result = defaultCase(theEObject); |
| 105 | return result; |
| 106 | } |
| 107 | case pipesandfiltersPackage.RECORDER: { |
| 108 | Recorder recorder = (Recorder)theEObject; |
| 109 | T result = caseRecorder(recorder); |
| 110 | if (result == null) result = casePipeElement(recorder); |
| 111 | if (result == null) result = caseIdentifier(recorder); |
| 112 | if (result == null) result = defaultCase(theEObject); |
| 113 | return result; |
| 114 | } |
| 115 | case pipesandfiltersPackage.AGGREGATION_RECORDER: { |
| 116 | AggregationRecorder aggregationRecorder = (AggregationRecorder)theEObject; |
| 117 | T result = caseAggregationRecorder(aggregationRecorder); |
| 118 | if (result == null) result = caseRecorder(aggregationRecorder); |
| 119 | if (result == null) result = casePipeElement(aggregationRecorder); |
| 120 | if (result == null) result = caseIdentifier(aggregationRecorder); |
| 121 | if (result == null) result = defaultCase(theEObject); |
| 122 | return result; |
| 123 | } |
| 124 | case pipesandfiltersPackage.WRITER: { |
| 125 | Writer writer = (Writer)theEObject; |
| 126 | T result = caseWriter(writer); |
| 127 | if (result == null) result = caseIdentifier(writer); |
| 128 | if (result == null) result = defaultCase(theEObject); |
| 129 | return result; |
| 130 | } |
| 131 | case pipesandfiltersPackage.RAW_RECORDER: { |
| 132 | RawRecorder rawRecorder = (RawRecorder)theEObject; |
| 133 | T result = caseRawRecorder(rawRecorder); |
| 134 | if (result == null) result = caseRecorder(rawRecorder); |
| 135 | if (result == null) result = casePipeElement(rawRecorder); |
| 136 | if (result == null) result = caseIdentifier(rawRecorder); |
| 137 | if (result == null) result = defaultCase(theEObject); |
| 138 | return result; |
| 139 | } |
| 140 | case pipesandfiltersPackage.SIMPLE_WARM_UP_FILTER: { |
| 141 | SimpleWarmUpFilter simpleWarmUpFilter = (SimpleWarmUpFilter)theEObject; |
| 142 | T result = caseSimpleWarmUpFilter(simpleWarmUpFilter); |
| 143 | if (result == null) result = caseFilter(simpleWarmUpFilter); |
| 144 | if (result == null) result = casePipeElement(simpleWarmUpFilter); |
| 145 | if (result == null) result = caseIdentifier(simpleWarmUpFilter); |
| 146 | if (result == null) result = defaultCase(theEObject); |
| 147 | return result; |
| 148 | } |
| 149 | case pipesandfiltersPackage.SLIDING_MEAN_RECORDER: { |
| 150 | SlidingMeanRecorder slidingMeanRecorder = (SlidingMeanRecorder)theEObject; |
| 151 | T result = caseSlidingMeanRecorder(slidingMeanRecorder); |
| 152 | if (result == null) result = caseAggregationRecorder(slidingMeanRecorder); |
| 153 | if (result == null) result = caseRecorder(slidingMeanRecorder); |
| 154 | if (result == null) result = casePipeElement(slidingMeanRecorder); |
| 155 | if (result == null) result = caseIdentifier(slidingMeanRecorder); |
| 156 | if (result == null) result = defaultCase(theEObject); |
| 157 | return result; |
| 158 | } |
| 159 | case pipesandfiltersPackage.EDP2_WRITER: { |
| 160 | EDP2Writer edp2Writer = (EDP2Writer)theEObject; |
| 161 | T result = caseEDP2Writer(edp2Writer); |
| 162 | if (result == null) result = caseWriter(edp2Writer); |
| 163 | if (result == null) result = caseIdentifier(edp2Writer); |
| 164 | if (result == null) result = defaultCase(theEObject); |
| 165 | return result; |
| 166 | } |
| 167 | case pipesandfiltersPackage.PIPES_AND_FILTERS_REPOSITORY: { |
| 168 | PipesAndFiltersRepository pipesAndFiltersRepository = (PipesAndFiltersRepository)theEObject; |
| 169 | T result = casePipesAndFiltersRepository(pipesAndFiltersRepository); |
| 170 | if (result == null) result = defaultCase(theEObject); |
| 171 | return result; |
| 172 | } |
| 173 | default: return defaultCase(theEObject); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Returns the result of interpreting the object as an instance of '<em>Pipe Element</em>'. |
| 179 | * <!-- begin-user-doc --> |
| 180 | * This implementation returns null; |
| 181 | * returning a non-null result will terminate the switch. |
| 182 | * <!-- end-user-doc --> |
| 183 | * @param object the target of the switch. |
| 184 | * @return the result of interpreting the object as an instance of '<em>Pipe Element</em>'. |
| 185 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 186 | * @generated |
| 187 | */ |
| 188 | public T casePipeElement(PipeElement object) { |
| 189 | return null; |
| 190 | } |
| 191 | |
| 192 | /** |
| 193 | * Returns the result of interpreting the object as an instance of '<em>Filter</em>'. |
| 194 | * <!-- begin-user-doc --> |
| 195 | * This implementation returns null; |
| 196 | * returning a non-null result will terminate the switch. |
| 197 | * <!-- end-user-doc --> |
| 198 | * @param object the target of the switch. |
| 199 | * @return the result of interpreting the object as an instance of '<em>Filter</em>'. |
| 200 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 201 | * @generated |
| 202 | */ |
| 203 | public T caseFilter(Filter object) { |
| 204 | return null; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Returns the result of interpreting the object as an instance of '<em>Recorder</em>'. |
| 209 | * <!-- begin-user-doc --> |
| 210 | * This implementation returns null; |
| 211 | * returning a non-null result will terminate the switch. |
| 212 | * <!-- end-user-doc --> |
| 213 | * @param object the target of the switch. |
| 214 | * @return the result of interpreting the object as an instance of '<em>Recorder</em>'. |
| 215 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 216 | * @generated |
| 217 | */ |
| 218 | public T caseRecorder(Recorder object) { |
| 219 | return null; |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Returns the result of interpreting the object as an instance of '<em>Aggregation Recorder</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 | * @param object the target of the switch. |
| 229 | * @return the result of interpreting the object as an instance of '<em>Aggregation Recorder</em>'. |
| 230 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 231 | * @generated |
| 232 | */ |
| 233 | public T caseAggregationRecorder(AggregationRecorder object) { |
| 234 | return null; |
| 235 | } |
| 236 | |
| 237 | /** |
| 238 | * Returns the result of interpreting the object as an instance of '<em>Writer</em>'. |
| 239 | * <!-- begin-user-doc --> |
| 240 | * This implementation returns null; |
| 241 | * returning a non-null result will terminate the switch. |
| 242 | * <!-- end-user-doc --> |
| 243 | * @param object the target of the switch. |
| 244 | * @return the result of interpreting the object as an instance of '<em>Writer</em>'. |
| 245 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 246 | * @generated |
| 247 | */ |
| 248 | public T caseWriter(Writer object) { |
| 249 | return null; |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Returns the result of interpreting the object as an instance of '<em>Raw Recorder</em>'. |
| 254 | * <!-- begin-user-doc --> |
| 255 | * This implementation returns null; |
| 256 | * returning a non-null result will terminate the switch. |
| 257 | * <!-- end-user-doc --> |
| 258 | * @param object the target of the switch. |
| 259 | * @return the result of interpreting the object as an instance of '<em>Raw Recorder</em>'. |
| 260 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 261 | * @generated |
| 262 | */ |
| 263 | public T caseRawRecorder(RawRecorder object) { |
| 264 | return null; |
| 265 | } |
| 266 | |
| 267 | /** |
| 268 | * Returns the result of interpreting the object as an instance of '<em>Simple Warm Up Filter</em>'. |
| 269 | * <!-- begin-user-doc --> |
| 270 | * This implementation returns null; |
| 271 | * returning a non-null result will terminate the switch. |
| 272 | * <!-- end-user-doc --> |
| 273 | * @param object the target of the switch. |
| 274 | * @return the result of interpreting the object as an instance of '<em>Simple Warm Up Filter</em>'. |
| 275 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 276 | * @generated |
| 277 | */ |
| 278 | public T caseSimpleWarmUpFilter(SimpleWarmUpFilter object) { |
| 279 | return null; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Returns the result of interpreting the object as an instance of '<em>Sliding Mean Recorder</em>'. |
| 284 | * <!-- begin-user-doc --> |
| 285 | * This implementation returns null; |
| 286 | * returning a non-null result will terminate the switch. |
| 287 | * <!-- end-user-doc --> |
| 288 | * @param object the target of the switch. |
| 289 | * @return the result of interpreting the object as an instance of '<em>Sliding Mean Recorder</em>'. |
| 290 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 291 | * @generated |
| 292 | */ |
| 293 | public T caseSlidingMeanRecorder(SlidingMeanRecorder object) { |
| 294 | return null; |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * Returns the result of interpreting the object as an instance of '<em>EDP2 Writer</em>'. |
| 299 | * <!-- begin-user-doc --> |
| 300 | * This implementation returns null; |
| 301 | * returning a non-null result will terminate the switch. |
| 302 | * <!-- end-user-doc --> |
| 303 | * @param object the target of the switch. |
| 304 | * @return the result of interpreting the object as an instance of '<em>EDP2 Writer</em>'. |
| 305 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 306 | * @generated |
| 307 | */ |
| 308 | public T caseEDP2Writer(EDP2Writer object) { |
| 309 | return null; |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * Returns the result of interpreting the object as an instance of '<em>Pipes And Filters Repository</em>'. |
| 314 | * <!-- begin-user-doc --> |
| 315 | * This implementation returns null; |
| 316 | * returning a non-null result will terminate the switch. |
| 317 | * <!-- end-user-doc --> |
| 318 | * @param object the target of the switch. |
| 319 | * @return the result of interpreting the object as an instance of '<em>Pipes And Filters Repository</em>'. |
| 320 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 321 | * @generated |
| 322 | */ |
| 323 | public T casePipesAndFiltersRepository(PipesAndFiltersRepository object) { |
| 324 | return null; |
| 325 | } |
| 326 | |
| 327 | /** |
| 328 | * Returns the result of interpreting the object as an instance of '<em>Identifier</em>'. |
| 329 | * <!-- begin-user-doc --> |
| 330 | * This implementation returns null; |
| 331 | * returning a non-null result will terminate the switch. |
| 332 | * <!-- end-user-doc --> |
| 333 | * @param object the target of the switch. |
| 334 | * @return the result of interpreting the object as an instance of '<em>Identifier</em>'. |
| 335 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
| 336 | * @generated |
| 337 | */ |
| 338 | public T caseIdentifier(Identifier object) { |
| 339 | return null; |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. |
| 344 | * <!-- begin-user-doc --> |
| 345 | * This implementation returns null; |
| 346 | * returning a non-null result will terminate the switch, but this is the last case anyway. |
| 347 | * <!-- end-user-doc --> |
| 348 | * @param object the target of the switch. |
| 349 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. |
| 350 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) |
| 351 | * @generated |
| 352 | */ |
| 353 | public T defaultCase(EObject object) { |
| 354 | return null; |
| 355 | } |
| 356 | |
| 357 | } //pipesandfiltersSwitch |