1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.probfunction.impl; |
8 | |
9 | import de.uka.ipd.sdq.probfunction.*; |
10 | import org.eclipse.emf.ecore.EClass; |
11 | import org.eclipse.emf.ecore.EObject; |
12 | import org.eclipse.emf.ecore.EPackage; |
13 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
14 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
15 | |
16 | import de.uka.ipd.sdq.probfunction.BoxedPDF; |
17 | import de.uka.ipd.sdq.probfunction.Complex; |
18 | import de.uka.ipd.sdq.probfunction.ContinuousSample; |
19 | import de.uka.ipd.sdq.probfunction.ExponentialDistribution; |
20 | import de.uka.ipd.sdq.probfunction.NormalDistribution; |
21 | import de.uka.ipd.sdq.probfunction.ProbabilityMassFunction; |
22 | import de.uka.ipd.sdq.probfunction.ProbfunctionFactory; |
23 | import de.uka.ipd.sdq.probfunction.ProbfunctionPackage; |
24 | import de.uka.ipd.sdq.probfunction.Sample; |
25 | import de.uka.ipd.sdq.probfunction.SamplePDF; |
26 | |
27 | /** |
28 | * <!-- begin-user-doc --> |
29 | * An implementation of the model <b>Factory</b>. |
30 | * <!-- end-user-doc --> |
31 | * @generated |
32 | */ |
33 | public class ProbfunctionFactoryImpl extends EFactoryImpl implements ProbfunctionFactory { |
34 | /** |
35 | * <!-- begin-user-doc --> |
36 | * <!-- end-user-doc --> |
37 | * @generated |
38 | */ |
39 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
40 | |
41 | /** |
42 | * Creates the default factory implementation. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @generated |
46 | */ |
47 | public static ProbfunctionFactory init() { |
48 | try { |
49 | ProbfunctionFactory theProbfunctionFactory = (ProbfunctionFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/ProbFunction/1.0"); |
50 | if (theProbfunctionFactory != null) { |
51 | return theProbfunctionFactory; |
52 | } |
53 | } |
54 | catch (Exception exception) { |
55 | EcorePlugin.INSTANCE.log(exception); |
56 | } |
57 | return new ProbfunctionFactoryImpl(); |
58 | } |
59 | |
60 | /** |
61 | * Creates an instance of the factory. |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | public ProbfunctionFactoryImpl() { |
67 | super(); |
68 | } |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | @Override |
76 | public EObject create(EClass eClass) { |
77 | switch (eClass.getClassifierID()) { |
78 | case ProbfunctionPackage.BOXED_PDF: return createBoxedPDF(); |
79 | case ProbfunctionPackage.CONTINUOUS_SAMPLE: return createContinuousSample(); |
80 | case ProbfunctionPackage.PROBABILITY_MASS_FUNCTION: return createProbabilityMassFunction(); |
81 | case ProbfunctionPackage.SAMPLE: return createSample(); |
82 | case ProbfunctionPackage.SAMPLE_PDF: return createSamplePDF(); |
83 | case ProbfunctionPackage.COMPLEX: return createComplex(); |
84 | case ProbfunctionPackage.EXPONENTIAL_DISTRIBUTION: return createExponentialDistribution(); |
85 | case ProbfunctionPackage.NORMAL_DISTRIBUTION: return createNormalDistribution(); |
86 | case ProbfunctionPackage.LOGNORMAL_DISTRIBUTION: return createLognormalDistribution(); |
87 | case ProbfunctionPackage.GAMMA_DISTRIBUTION: return createGammaDistribution(); |
88 | default: |
89 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
90 | } |
91 | } |
92 | |
93 | /** |
94 | * <!-- begin-user-doc --> |
95 | * <!-- end-user-doc --> |
96 | * @generated |
97 | */ |
98 | public BoxedPDF createBoxedPDF() { |
99 | BoxedPDFImpl boxedPDF = new BoxedPDFImpl(); |
100 | return boxedPDF; |
101 | } |
102 | |
103 | /** |
104 | * <!-- begin-user-doc --> |
105 | * <!-- end-user-doc --> |
106 | * @generated |
107 | */ |
108 | public ContinuousSample createContinuousSample() { |
109 | ContinuousSampleImpl continuousSample = new ContinuousSampleImpl(); |
110 | return continuousSample; |
111 | } |
112 | |
113 | /** |
114 | * <!-- begin-user-doc --> |
115 | * <!-- end-user-doc --> |
116 | * @generated |
117 | */ |
118 | public ProbabilityMassFunction createProbabilityMassFunction() { |
119 | ProbabilityMassFunctionImpl probabilityMassFunction = new ProbabilityMassFunctionImpl(); |
120 | return probabilityMassFunction; |
121 | } |
122 | |
123 | /** |
124 | * <!-- begin-user-doc --> |
125 | * <!-- end-user-doc --> |
126 | * @generated |
127 | */ |
128 | public <T> Sample<T> createSample() { |
129 | SampleImpl<T> sample = new SampleImpl<T>(); |
130 | return sample; |
131 | } |
132 | |
133 | /** |
134 | * <!-- begin-user-doc --> |
135 | * <!-- end-user-doc --> |
136 | * @generated |
137 | */ |
138 | public SamplePDF createSamplePDF() { |
139 | SamplePDFImpl samplePDF = new SamplePDFImpl(); |
140 | return samplePDF; |
141 | } |
142 | |
143 | /** |
144 | * <!-- begin-user-doc --> |
145 | * <!-- end-user-doc --> |
146 | * @generated |
147 | */ |
148 | public Complex createComplex() { |
149 | ComplexImpl complex = new ComplexImpl(); |
150 | return complex; |
151 | } |
152 | |
153 | /** |
154 | * <!-- begin-user-doc --> |
155 | * <!-- end-user-doc --> |
156 | * @generated |
157 | */ |
158 | public ExponentialDistribution createExponentialDistribution() { |
159 | ExponentialDistributionImpl exponentialDistribution = new ExponentialDistributionImpl(); |
160 | return exponentialDistribution; |
161 | } |
162 | |
163 | /** |
164 | * <!-- begin-user-doc --> |
165 | * <!-- end-user-doc --> |
166 | * @generated |
167 | */ |
168 | public NormalDistribution createNormalDistribution() { |
169 | NormalDistributionImpl normalDistribution = new NormalDistributionImpl(); |
170 | return normalDistribution; |
171 | } |
172 | |
173 | /** |
174 | * <!-- begin-user-doc --> |
175 | * <!-- end-user-doc --> |
176 | * @generated |
177 | */ |
178 | public LognormalDistribution createLognormalDistribution() { |
179 | LognormalDistributionImpl lognormalDistribution = new LognormalDistributionImpl(); |
180 | return lognormalDistribution; |
181 | } |
182 | |
183 | /** |
184 | * <!-- begin-user-doc --> |
185 | * <!-- end-user-doc --> |
186 | * @generated |
187 | */ |
188 | public GammaDistribution createGammaDistribution() { |
189 | GammaDistributionImpl gammaDistribution = new GammaDistributionImpl(); |
190 | return gammaDistribution; |
191 | } |
192 | |
193 | /** |
194 | * <!-- begin-user-doc --> |
195 | * <!-- end-user-doc --> |
196 | * @generated |
197 | */ |
198 | public ProbfunctionPackage getProbfunctionPackage() { |
199 | return (ProbfunctionPackage)getEPackage(); |
200 | } |
201 | |
202 | /** |
203 | * <!-- begin-user-doc --> |
204 | * <!-- end-user-doc --> |
205 | * @deprecated |
206 | * @generated |
207 | */ |
208 | @Deprecated |
209 | public static ProbfunctionPackage getPackage() { |
210 | return ProbfunctionPackage.eINSTANCE; |
211 | } |
212 | |
213 | } //ProbfunctionFactoryImpl |