| 1 | /** |
| 2 | * Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.pcm.core.util; |
| 7 | |
| 8 | import de.uka.ipd.sdq.pcm.core.*; |
| 9 | import org.eclipse.emf.common.notify.Adapter; |
| 10 | import org.eclipse.emf.common.notify.Notifier; |
| 11 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; |
| 12 | import org.eclipse.emf.ecore.EObject; |
| 13 | |
| 14 | import de.uka.ipd.sdq.pcm.core.CorePackage; |
| 15 | import de.uka.ipd.sdq.pcm.core.PCMRandomVariable; |
| 16 | import de.uka.ipd.sdq.stoex.RandomVariable; |
| 17 | |
| 18 | /** |
| 19 | * <!-- begin-user-doc --> |
| 20 | * The <b>Adapter Factory</b> for the model. |
| 21 | * It provides an adapter <code>createXXX</code> method for each class of the model. |
| 22 | * <!-- end-user-doc --> |
| 23 | * @see de.uka.ipd.sdq.pcm.core.CorePackage |
| 24 | * @generated |
| 25 | */ |
| 26 | public class CoreAdapterFactory extends AdapterFactoryImpl { |
| 27 | /** |
| 28 | * <!-- begin-user-doc --> |
| 29 | * <!-- end-user-doc --> |
| 30 | * @generated |
| 31 | */ |
| 32 | public static final String copyright = "Copyright 2005-2009 by SDQ, IPD, University of Karlsruhe, Germany"; |
| 33 | |
| 34 | /** |
| 35 | * The cached model package. |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @generated |
| 39 | */ |
| 40 | protected static CorePackage modelPackage; |
| 41 | |
| 42 | /** |
| 43 | * Creates an instance of the adapter factory. |
| 44 | * <!-- begin-user-doc --> |
| 45 | * <!-- end-user-doc --> |
| 46 | * @generated |
| 47 | */ |
| 48 | public CoreAdapterFactory() { |
| 49 | if (modelPackage == null) { |
| 50 | modelPackage = CorePackage.eINSTANCE; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Returns whether this factory is applicable for the type of the object. |
| 56 | * <!-- begin-user-doc --> |
| 57 | * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. |
| 58 | * <!-- end-user-doc --> |
| 59 | * @return whether this factory is applicable for the type of the object. |
| 60 | * @generated |
| 61 | */ |
| 62 | @Override |
| 63 | public boolean isFactoryForType(Object object) { |
| 64 | if (object == modelPackage) { |
| 65 | return true; |
| 66 | } |
| 67 | if (object instanceof EObject) { |
| 68 | return ((EObject)object).eClass().getEPackage() == modelPackage; |
| 69 | } |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * The switch that delegates to the <code>createXXX</code> methods. |
| 75 | * <!-- begin-user-doc --> |
| 76 | * <!-- end-user-doc --> |
| 77 | * @generated |
| 78 | */ |
| 79 | protected CoreSwitch<Adapter> modelSwitch = |
| 80 | new CoreSwitch<Adapter>() { |
| 81 | @Override |
| 82 | public Adapter casePCMRandomVariable(PCMRandomVariable object) { |
| 83 | return createPCMRandomVariableAdapter(); |
| 84 | } |
| 85 | @Override |
| 86 | public Adapter caseRandomVariable(RandomVariable object) { |
| 87 | return createRandomVariableAdapter(); |
| 88 | } |
| 89 | @Override |
| 90 | public Adapter defaultCase(EObject object) { |
| 91 | return createEObjectAdapter(); |
| 92 | } |
| 93 | }; |
| 94 | |
| 95 | /** |
| 96 | * Creates an adapter for the <code>target</code>. |
| 97 | * <!-- begin-user-doc --> |
| 98 | * <!-- end-user-doc --> |
| 99 | * @param target the object to adapt. |
| 100 | * @return the adapter for the <code>target</code>. |
| 101 | * @generated |
| 102 | */ |
| 103 | @Override |
| 104 | public Adapter createAdapter(Notifier target) { |
| 105 | return modelSwitch.doSwitch((EObject)target); |
| 106 | } |
| 107 | |
| 108 | |
| 109 | /** |
| 110 | * Creates a new adapter for an object of class '{@link de.uka.ipd.sdq.pcm.core.PCMRandomVariable <em>PCM Random Variable</em>}'. |
| 111 | * <!-- begin-user-doc --> |
| 112 | * This default implementation returns null so that we can easily ignore cases; |
| 113 | * it's useful to ignore a case when inheritance will catch all the cases anyway. |
| 114 | * <!-- end-user-doc --> |
| 115 | * @return the new adapter. |
| 116 | * @see de.uka.ipd.sdq.pcm.core.PCMRandomVariable |
| 117 | * @generated |
| 118 | */ |
| 119 | public Adapter createPCMRandomVariableAdapter() { |
| 120 | return null; |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * Creates a new adapter for an object of class '{@link de.uka.ipd.sdq.stoex.RandomVariable <em>Random Variable</em>}'. |
| 125 | * <!-- begin-user-doc --> |
| 126 | * This default implementation returns null so that we can easily ignore cases; |
| 127 | * it's useful to ignore a case when inheritance will catch all the cases anyway. |
| 128 | * <!-- end-user-doc --> |
| 129 | * @return the new adapter. |
| 130 | * @see de.uka.ipd.sdq.stoex.RandomVariable |
| 131 | * @generated |
| 132 | */ |
| 133 | public Adapter createRandomVariableAdapter() { |
| 134 | return null; |
| 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Creates a new adapter for the default case. |
| 139 | * <!-- begin-user-doc --> |
| 140 | * This default implementation returns null. |
| 141 | * <!-- end-user-doc --> |
| 142 | * @return the new adapter. |
| 143 | * @generated |
| 144 | */ |
| 145 | public Adapter createEObjectAdapter() { |
| 146 | return null; |
| 147 | } |
| 148 | |
| 149 | } //CoreAdapterFactory |