1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.markov.impl; |
8 | |
9 | import de.uka.ipd.sdq.markov.Entity; |
10 | import de.uka.ipd.sdq.markov.Label; |
11 | import de.uka.ipd.sdq.markov.MarkovChain; |
12 | import de.uka.ipd.sdq.markov.MarkovFactory; |
13 | import de.uka.ipd.sdq.markov.MarkovPackage; |
14 | import de.uka.ipd.sdq.markov.State; |
15 | import de.uka.ipd.sdq.markov.StateType; |
16 | import de.uka.ipd.sdq.markov.Transition; |
17 | |
18 | import org.eclipse.emf.ecore.EAttribute; |
19 | import org.eclipse.emf.ecore.EClass; |
20 | import org.eclipse.emf.ecore.EEnum; |
21 | import org.eclipse.emf.ecore.EPackage; |
22 | import org.eclipse.emf.ecore.EReference; |
23 | |
24 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
25 | |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * An implementation of the model <b>Package</b>. |
29 | * <!-- end-user-doc --> |
30 | * @generated |
31 | */ |
32 | public class MarkovPackageImpl extends EPackageImpl implements MarkovPackage { |
33 | /** |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | private EClass stateEClass = null; |
39 | |
40 | /** |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @generated |
44 | */ |
45 | private EClass transitionEClass = null; |
46 | |
47 | /** |
48 | * <!-- begin-user-doc --> |
49 | * <!-- end-user-doc --> |
50 | * @generated |
51 | */ |
52 | private EClass markovChainEClass = null; |
53 | |
54 | /** |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @generated |
58 | */ |
59 | private EClass entityEClass = null; |
60 | |
61 | /** |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | private EClass labelEClass = null; |
67 | |
68 | /** |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @generated |
72 | */ |
73 | private EEnum stateTypeEEnum = null; |
74 | |
75 | /** |
76 | * Creates an instance of the model <b>Package</b>, registered with |
77 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
78 | * package URI value. |
79 | * <p>Note: the correct way to create the package is via the static |
80 | * factory method {@link #init init()}, which also performs |
81 | * initialization of the package, or returns the registered package, |
82 | * if one already exists. |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @see org.eclipse.emf.ecore.EPackage.Registry |
86 | * @see de.uka.ipd.sdq.markov.MarkovPackage#eNS_URI |
87 | * @see #init() |
88 | * @generated |
89 | */ |
90 | private MarkovPackageImpl() { |
91 | super(eNS_URI, MarkovFactory.eINSTANCE); |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | private static boolean isInited = false; |
100 | |
101 | /** |
102 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
103 | * |
104 | * <p>This method is used to initialize {@link MarkovPackage#eINSTANCE} when that field is accessed. |
105 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
106 | * <!-- begin-user-doc --> |
107 | * <!-- end-user-doc --> |
108 | * @see #eNS_URI |
109 | * @see #createPackageContents() |
110 | * @see #initializePackageContents() |
111 | * @generated |
112 | */ |
113 | public static MarkovPackage init() { |
114 | if (isInited) return (MarkovPackage)EPackage.Registry.INSTANCE.getEPackage(MarkovPackage.eNS_URI); |
115 | |
116 | // Obtain or create and register package |
117 | MarkovPackageImpl theMarkovPackage = (MarkovPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MarkovPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MarkovPackageImpl()); |
118 | |
119 | isInited = true; |
120 | |
121 | // Create package meta-data objects |
122 | theMarkovPackage.createPackageContents(); |
123 | |
124 | // Initialize created meta-data |
125 | theMarkovPackage.initializePackageContents(); |
126 | |
127 | // Mark meta-data to indicate it can't be changed |
128 | theMarkovPackage.freeze(); |
129 | |
130 | |
131 | // Update the registry and return the package |
132 | EPackage.Registry.INSTANCE.put(MarkovPackage.eNS_URI, theMarkovPackage); |
133 | return theMarkovPackage; |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | public EClass getState() { |
142 | return stateEClass; |
143 | } |
144 | |
145 | /** |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | public EAttribute getState_Type() { |
151 | return (EAttribute)stateEClass.getEStructuralFeatures().get(0); |
152 | } |
153 | |
154 | /** |
155 | * <!-- begin-user-doc --> |
156 | * <!-- end-user-doc --> |
157 | * @generated |
158 | */ |
159 | public EReference getState_Labels() { |
160 | return (EReference)stateEClass.getEStructuralFeatures().get(1); |
161 | } |
162 | |
163 | /** |
164 | * <!-- begin-user-doc --> |
165 | * <!-- end-user-doc --> |
166 | * @generated |
167 | */ |
168 | public EAttribute getState_Traces() { |
169 | return (EAttribute)stateEClass.getEStructuralFeatures().get(2); |
170 | } |
171 | |
172 | /** |
173 | * <!-- begin-user-doc --> |
174 | * <!-- end-user-doc --> |
175 | * @generated |
176 | */ |
177 | public EClass getTransition() { |
178 | return transitionEClass; |
179 | } |
180 | |
181 | /** |
182 | * <!-- begin-user-doc --> |
183 | * <!-- end-user-doc --> |
184 | * @generated |
185 | */ |
186 | public EAttribute getTransition_Probability() { |
187 | return (EAttribute)transitionEClass.getEStructuralFeatures().get(0); |
188 | } |
189 | |
190 | /** |
191 | * <!-- begin-user-doc --> |
192 | * <!-- end-user-doc --> |
193 | * @generated |
194 | */ |
195 | public EReference getTransition_FromState() { |
196 | return (EReference)transitionEClass.getEStructuralFeatures().get(1); |
197 | } |
198 | |
199 | /** |
200 | * <!-- begin-user-doc --> |
201 | * <!-- end-user-doc --> |
202 | * @generated |
203 | */ |
204 | public EReference getTransition_ToState() { |
205 | return (EReference)transitionEClass.getEStructuralFeatures().get(2); |
206 | } |
207 | |
208 | /** |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | public EClass getMarkovChain() { |
214 | return markovChainEClass; |
215 | } |
216 | |
217 | /** |
218 | * <!-- begin-user-doc --> |
219 | * <!-- end-user-doc --> |
220 | * @generated |
221 | */ |
222 | public EReference getMarkovChain_States() { |
223 | return (EReference)markovChainEClass.getEStructuralFeatures().get(0); |
224 | } |
225 | |
226 | /** |
227 | * <!-- begin-user-doc --> |
228 | * <!-- end-user-doc --> |
229 | * @generated |
230 | */ |
231 | public EReference getMarkovChain_Transitions() { |
232 | return (EReference)markovChainEClass.getEStructuralFeatures().get(1); |
233 | } |
234 | |
235 | /** |
236 | * <!-- begin-user-doc --> |
237 | * <!-- end-user-doc --> |
238 | * @generated |
239 | */ |
240 | public EClass getEntity() { |
241 | return entityEClass; |
242 | } |
243 | |
244 | /** |
245 | * <!-- begin-user-doc --> |
246 | * <!-- end-user-doc --> |
247 | * @generated |
248 | */ |
249 | public EAttribute getEntity_Name() { |
250 | return (EAttribute)entityEClass.getEStructuralFeatures().get(0); |
251 | } |
252 | |
253 | /** |
254 | * <!-- begin-user-doc --> |
255 | * <!-- end-user-doc --> |
256 | * @generated |
257 | */ |
258 | public EClass getLabel() { |
259 | return labelEClass; |
260 | } |
261 | |
262 | /** |
263 | * <!-- begin-user-doc --> |
264 | * <!-- end-user-doc --> |
265 | * @generated |
266 | */ |
267 | public EAttribute getLabel_Key() { |
268 | return (EAttribute)labelEClass.getEStructuralFeatures().get(0); |
269 | } |
270 | |
271 | /** |
272 | * <!-- begin-user-doc --> |
273 | * <!-- end-user-doc --> |
274 | * @generated |
275 | */ |
276 | public EAttribute getLabel_Value() { |
277 | return (EAttribute)labelEClass.getEStructuralFeatures().get(1); |
278 | } |
279 | |
280 | /** |
281 | * <!-- begin-user-doc --> |
282 | * <!-- end-user-doc --> |
283 | * @generated |
284 | */ |
285 | public EEnum getStateType() { |
286 | return stateTypeEEnum; |
287 | } |
288 | |
289 | /** |
290 | * <!-- begin-user-doc --> |
291 | * <!-- end-user-doc --> |
292 | * @generated |
293 | */ |
294 | public MarkovFactory getMarkovFactory() { |
295 | return (MarkovFactory)getEFactoryInstance(); |
296 | } |
297 | |
298 | /** |
299 | * <!-- begin-user-doc --> |
300 | * <!-- end-user-doc --> |
301 | * @generated |
302 | */ |
303 | private boolean isCreated = false; |
304 | |
305 | /** |
306 | * Creates the meta-model objects for the package. This method is |
307 | * guarded to have no affect on any invocation but its first. |
308 | * <!-- begin-user-doc --> |
309 | * <!-- end-user-doc --> |
310 | * @generated |
311 | */ |
312 | public void createPackageContents() { |
313 | if (isCreated) return; |
314 | isCreated = true; |
315 | |
316 | // Create classes and their features |
317 | stateEClass = createEClass(STATE); |
318 | createEAttribute(stateEClass, STATE__TYPE); |
319 | createEReference(stateEClass, STATE__LABELS); |
320 | createEAttribute(stateEClass, STATE__TRACES); |
321 | |
322 | transitionEClass = createEClass(TRANSITION); |
323 | createEAttribute(transitionEClass, TRANSITION__PROBABILITY); |
324 | createEReference(transitionEClass, TRANSITION__FROM_STATE); |
325 | createEReference(transitionEClass, TRANSITION__TO_STATE); |
326 | |
327 | markovChainEClass = createEClass(MARKOV_CHAIN); |
328 | createEReference(markovChainEClass, MARKOV_CHAIN__STATES); |
329 | createEReference(markovChainEClass, MARKOV_CHAIN__TRANSITIONS); |
330 | |
331 | entityEClass = createEClass(ENTITY); |
332 | createEAttribute(entityEClass, ENTITY__NAME); |
333 | |
334 | labelEClass = createEClass(LABEL); |
335 | createEAttribute(labelEClass, LABEL__KEY); |
336 | createEAttribute(labelEClass, LABEL__VALUE); |
337 | |
338 | // Create enums |
339 | stateTypeEEnum = createEEnum(STATE_TYPE); |
340 | } |
341 | |
342 | /** |
343 | * <!-- begin-user-doc --> |
344 | * <!-- end-user-doc --> |
345 | * @generated |
346 | */ |
347 | private boolean isInitialized = false; |
348 | |
349 | /** |
350 | * Complete the initialization of the package and its meta-model. This |
351 | * method is guarded to have no affect on any invocation but its first. |
352 | * <!-- begin-user-doc --> |
353 | * <!-- end-user-doc --> |
354 | * @generated |
355 | */ |
356 | public void initializePackageContents() { |
357 | if (isInitialized) return; |
358 | isInitialized = true; |
359 | |
360 | // Initialize package |
361 | setName(eNAME); |
362 | setNsPrefix(eNS_PREFIX); |
363 | setNsURI(eNS_URI); |
364 | |
365 | // Create type parameters |
366 | |
367 | // Set bounds for type parameters |
368 | |
369 | // Add supertypes to classes |
370 | stateEClass.getESuperTypes().add(this.getEntity()); |
371 | transitionEClass.getESuperTypes().add(this.getEntity()); |
372 | markovChainEClass.getESuperTypes().add(this.getEntity()); |
373 | |
374 | // Initialize classes and features; add operations and parameters |
375 | initEClass(stateEClass, State.class, "State", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
376 | initEAttribute(getState_Type(), this.getStateType(), "type", null, 1, 1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
377 | initEReference(getState_Labels(), this.getLabel(), null, "labels", null, 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
378 | getState_Labels().getEKeys().add(this.getLabel_Key()); |
379 | initEAttribute(getState_Traces(), ecorePackage.getEString(), "traces", "", 0, -1, State.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
380 | |
381 | initEClass(transitionEClass, Transition.class, "Transition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
382 | initEAttribute(getTransition_Probability(), ecorePackage.getEDouble(), "probability", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
383 | initEReference(getTransition_FromState(), this.getState(), null, "fromState", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
384 | initEReference(getTransition_ToState(), this.getState(), null, "toState", null, 1, 1, Transition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
385 | |
386 | initEClass(markovChainEClass, MarkovChain.class, "MarkovChain", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
387 | initEReference(getMarkovChain_States(), this.getState(), null, "states", null, 0, -1, MarkovChain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
388 | initEReference(getMarkovChain_Transitions(), this.getTransition(), null, "transitions", null, 0, -1, MarkovChain.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
389 | |
390 | initEClass(entityEClass, Entity.class, "Entity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
391 | initEAttribute(getEntity_Name(), ecorePackage.getEString(), "Name", null, 1, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
392 | |
393 | initEClass(labelEClass, Label.class, "Label", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
394 | initEAttribute(getLabel_Key(), ecorePackage.getEString(), "key", null, 0, 1, Label.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
395 | initEAttribute(getLabel_Value(), ecorePackage.getEString(), "value", null, 0, 1, Label.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
396 | |
397 | // Initialize enums and add enum literals |
398 | initEEnum(stateTypeEEnum, StateType.class, "StateType"); |
399 | addEEnumLiteral(stateTypeEEnum, StateType.DEFAULT); |
400 | addEEnumLiteral(stateTypeEEnum, StateType.START); |
401 | addEEnumLiteral(stateTypeEEnum, StateType.SUCCESS); |
402 | addEEnumLiteral(stateTypeEEnum, StateType.FAILURE); |
403 | |
404 | // Create resource |
405 | createResource(eNS_URI); |
406 | } |
407 | |
408 | } //MarkovPackageImpl |