1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.spa.impl; |
8 | |
9 | import de.uka.ipd.sdq.probfunction.ProbfunctionPackage; |
10 | |
11 | import de.uka.ipd.sdq.spa.ProcessBehaviour; |
12 | import de.uka.ipd.sdq.spa.SPAModel; |
13 | import de.uka.ipd.sdq.spa.SpaFactory; |
14 | import de.uka.ipd.sdq.spa.SpaPackage; |
15 | |
16 | import de.uka.ipd.sdq.spa.expression.ExpressionPackage; |
17 | |
18 | import de.uka.ipd.sdq.spa.expression.impl.ExpressionPackageImpl; |
19 | |
20 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceModelPackage; |
21 | |
22 | import org.eclipse.emf.ecore.EAttribute; |
23 | import org.eclipse.emf.ecore.EClass; |
24 | import org.eclipse.emf.ecore.EPackage; |
25 | import org.eclipse.emf.ecore.EReference; |
26 | |
27 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
28 | |
29 | /** |
30 | * <!-- begin-user-doc --> |
31 | * An implementation of the model <b>Package</b>. |
32 | * <!-- end-user-doc --> |
33 | * @generated |
34 | */ |
35 | public class SpaPackageImpl extends EPackageImpl implements SpaPackage { |
36 | /** |
37 | * <!-- begin-user-doc --> |
38 | * <!-- end-user-doc --> |
39 | * @generated |
40 | */ |
41 | private EClass processBehaviourEClass = null; |
42 | |
43 | /** |
44 | * <!-- begin-user-doc --> |
45 | * <!-- end-user-doc --> |
46 | * @generated |
47 | */ |
48 | private EClass spaModelEClass = null; |
49 | |
50 | /** |
51 | * Creates an instance of the model <b>Package</b>, registered with |
52 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
53 | * package URI value. |
54 | * <p>Note: the correct way to create the package is via the static |
55 | * factory method {@link #init init()}, which also performs |
56 | * initialization of the package, or returns the registered package, |
57 | * if one already exists. |
58 | * <!-- begin-user-doc --> |
59 | * <!-- end-user-doc --> |
60 | * @see org.eclipse.emf.ecore.EPackage.Registry |
61 | * @see de.uka.ipd.sdq.spa.SpaPackage#eNS_URI |
62 | * @see #init() |
63 | * @generated |
64 | */ |
65 | private SpaPackageImpl() { |
66 | super(eNS_URI, SpaFactory.eINSTANCE); |
67 | } |
68 | |
69 | /** |
70 | * <!-- begin-user-doc --> |
71 | * <!-- end-user-doc --> |
72 | * @generated |
73 | */ |
74 | private static boolean isInited = false; |
75 | |
76 | /** |
77 | * Creates, registers, and initializes the <b>Package</b> for this |
78 | * model, and for any others upon which it depends. Simple |
79 | * dependencies are satisfied by calling this method on all |
80 | * dependent packages before doing anything else. This method drives |
81 | * initialization for interdependent packages directly, in parallel |
82 | * with this package, itself. |
83 | * <p>Of this package and its interdependencies, all packages which |
84 | * have not yet been registered by their URI values are first created |
85 | * and registered. The packages are then initialized in two steps: |
86 | * meta-model objects for all of the packages are created before any |
87 | * are initialized, since one package's meta-model objects may refer to |
88 | * those of another. |
89 | * <p>Invocation of this method will not affect any packages that have |
90 | * already been initialized. |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @see #eNS_URI |
94 | * @see #createPackageContents() |
95 | * @see #initializePackageContents() |
96 | * @generated |
97 | */ |
98 | public static SpaPackage init() { |
99 | if (isInited) return (SpaPackage)EPackage.Registry.INSTANCE.getEPackage(SpaPackage.eNS_URI); |
100 | |
101 | // Obtain or create and register package |
102 | SpaPackageImpl theSpaPackage = (SpaPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof SpaPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new SpaPackageImpl()); |
103 | |
104 | isInited = true; |
105 | |
106 | // Initialize simple dependencies |
107 | ProbfunctionPackage.eINSTANCE.eClass(); |
108 | ResourceModelPackage.eINSTANCE.eClass(); |
109 | |
110 | // Obtain or create and register interdependencies |
111 | ExpressionPackageImpl theExpressionPackage = (ExpressionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ExpressionPackage.eNS_URI) instanceof ExpressionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ExpressionPackage.eNS_URI) : ExpressionPackage.eINSTANCE); |
112 | |
113 | // Create package meta-data objects |
114 | theSpaPackage.createPackageContents(); |
115 | theExpressionPackage.createPackageContents(); |
116 | |
117 | // Initialize created meta-data |
118 | theSpaPackage.initializePackageContents(); |
119 | theExpressionPackage.initializePackageContents(); |
120 | |
121 | // Mark meta-data to indicate it can't be changed |
122 | theSpaPackage.freeze(); |
123 | |
124 | return theSpaPackage; |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | public EClass getProcessBehaviour() { |
133 | return processBehaviourEClass; |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | public EAttribute getProcessBehaviour_NumReplicas() { |
142 | return (EAttribute)processBehaviourEClass.getEStructuralFeatures().get(0); |
143 | } |
144 | |
145 | /** |
146 | * <!-- begin-user-doc --> |
147 | * <!-- end-user-doc --> |
148 | * @generated |
149 | */ |
150 | public EAttribute getProcessBehaviour_Name() { |
151 | return (EAttribute)processBehaviourEClass.getEStructuralFeatures().get(1); |
152 | } |
153 | |
154 | /** |
155 | * <!-- begin-user-doc --> |
156 | * <!-- end-user-doc --> |
157 | * @generated |
158 | */ |
159 | public EReference getProcessBehaviour_Behaviour() { |
160 | return (EReference)processBehaviourEClass.getEStructuralFeatures().get(2); |
161 | } |
162 | |
163 | /** |
164 | * <!-- begin-user-doc --> |
165 | * <!-- end-user-doc --> |
166 | * @generated |
167 | */ |
168 | public EClass getSPAModel() { |
169 | return spaModelEClass; |
170 | } |
171 | |
172 | /** |
173 | * <!-- begin-user-doc --> |
174 | * <!-- end-user-doc --> |
175 | * @generated |
176 | */ |
177 | public EReference getSPAModel_Processes() { |
178 | return (EReference)spaModelEClass.getEStructuralFeatures().get(0); |
179 | } |
180 | |
181 | /** |
182 | * <!-- begin-user-doc --> |
183 | * <!-- end-user-doc --> |
184 | * @generated |
185 | */ |
186 | public EReference getSPAModel_Resources() { |
187 | return (EReference)spaModelEClass.getEStructuralFeatures().get(1); |
188 | } |
189 | |
190 | /** |
191 | * <!-- begin-user-doc --> |
192 | * <!-- end-user-doc --> |
193 | * @generated |
194 | */ |
195 | public SpaFactory getSpaFactory() { |
196 | return (SpaFactory)getEFactoryInstance(); |
197 | } |
198 | |
199 | /** |
200 | * <!-- begin-user-doc --> |
201 | * <!-- end-user-doc --> |
202 | * @generated |
203 | */ |
204 | private boolean isCreated = false; |
205 | |
206 | /** |
207 | * Creates the meta-model objects for the package. This method is |
208 | * guarded to have no affect on any invocation but its first. |
209 | * <!-- begin-user-doc --> |
210 | * <!-- end-user-doc --> |
211 | * @generated |
212 | */ |
213 | public void createPackageContents() { |
214 | if (isCreated) return; |
215 | isCreated = true; |
216 | |
217 | // Create classes and their features |
218 | processBehaviourEClass = createEClass(PROCESS_BEHAVIOUR); |
219 | createEAttribute(processBehaviourEClass, PROCESS_BEHAVIOUR__NUM_REPLICAS); |
220 | createEAttribute(processBehaviourEClass, PROCESS_BEHAVIOUR__NAME); |
221 | createEReference(processBehaviourEClass, PROCESS_BEHAVIOUR__BEHAVIOUR); |
222 | |
223 | spaModelEClass = createEClass(SPA_MODEL); |
224 | createEReference(spaModelEClass, SPA_MODEL__PROCESSES); |
225 | createEReference(spaModelEClass, SPA_MODEL__RESOURCES); |
226 | } |
227 | |
228 | /** |
229 | * <!-- begin-user-doc --> |
230 | * <!-- end-user-doc --> |
231 | * @generated |
232 | */ |
233 | private boolean isInitialized = false; |
234 | |
235 | /** |
236 | * Complete the initialization of the package and its meta-model. This |
237 | * method is guarded to have no affect on any invocation but its first. |
238 | * <!-- begin-user-doc --> |
239 | * <!-- end-user-doc --> |
240 | * @generated |
241 | */ |
242 | public void initializePackageContents() { |
243 | if (isInitialized) return; |
244 | isInitialized = true; |
245 | |
246 | // Initialize package |
247 | setName(eNAME); |
248 | setNsPrefix(eNS_PREFIX); |
249 | setNsURI(eNS_URI); |
250 | |
251 | // Obtain other dependent packages |
252 | ExpressionPackage theExpressionPackage = (ExpressionPackage)EPackage.Registry.INSTANCE.getEPackage(ExpressionPackage.eNS_URI); |
253 | ResourceModelPackage theResourceModelPackage = (ResourceModelPackage)EPackage.Registry.INSTANCE.getEPackage(ResourceModelPackage.eNS_URI); |
254 | |
255 | // Add subpackages |
256 | getESubpackages().add(theExpressionPackage); |
257 | |
258 | // Create type parameters |
259 | |
260 | // Set bounds for type parameters |
261 | |
262 | // Add supertypes to classes |
263 | |
264 | // Initialize classes and features; add operations and parameters |
265 | initEClass(processBehaviourEClass, ProcessBehaviour.class, "ProcessBehaviour", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
266 | initEAttribute(getProcessBehaviour_NumReplicas(), ecorePackage.getEInt(), "numReplicas", null, 0, 1, ProcessBehaviour.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
267 | initEAttribute(getProcessBehaviour_Name(), ecorePackage.getEString(), "name", "", 0, 1, ProcessBehaviour.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
268 | initEReference(getProcessBehaviour_Behaviour(), theExpressionPackage.getExpression(), null, "behaviour", null, 1, 1, ProcessBehaviour.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
269 | |
270 | initEClass(spaModelEClass, SPAModel.class, "SPAModel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
271 | initEReference(getSPAModel_Processes(), this.getProcessBehaviour(), null, "processes", null, 0, -1, SPAModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
272 | initEReference(getSPAModel_Resources(), theResourceModelPackage.getResource(), null, "resources", null, 0, -1, SPAModel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
273 | |
274 | // Create resource |
275 | createResource(eNS_URI); |
276 | } |
277 | |
278 | } //SpaPackageImpl |