| 1 | /** |
| 2 | * Copyright 2006, SDQ Group, University Karlsruhe (TH) |
| 3 | * |
| 4 | * $Id$ |
| 5 | */ |
| 6 | package de.uka.ipd.sdq.context.computed_allocation.impl; |
| 7 | |
| 8 | import org.eclipse.emf.ecore.EClass; |
| 9 | import org.eclipse.emf.ecore.EPackage; |
| 10 | import org.eclipse.emf.ecore.EReference; |
| 11 | import org.eclipse.emf.ecore.impl.EPackageImpl; |
| 12 | |
| 13 | import de.uka.ipd.sdq.context.aggregatedUsageContext.AggregatedUsageContextPackage; |
| 14 | import de.uka.ipd.sdq.context.aggregatedUsageContext.impl.AggregatedUsageContextPackageImpl; |
| 15 | import de.uka.ipd.sdq.context.computed_allocation.ComputedAllocation; |
| 16 | import de.uka.ipd.sdq.context.computed_allocation.ComputedAllocationContext; |
| 17 | import de.uka.ipd.sdq.context.computed_allocation.ComputedAllocationFactory; |
| 18 | import de.uka.ipd.sdq.context.computed_allocation.ComputedAllocationPackage; |
| 19 | import de.uka.ipd.sdq.context.computed_allocation.ResourceDemand; |
| 20 | import de.uka.ipd.sdq.context.computed_usage.ComputedUsagePackage; |
| 21 | import de.uka.ipd.sdq.context.computed_usage.impl.ComputedUsagePackageImpl; |
| 22 | import de.uka.ipd.sdq.pcm.PcmPackage; |
| 23 | import de.uka.ipd.sdq.pcm.allocation.AllocationPackage; |
| 24 | import de.uka.ipd.sdq.pcm.core.CorePackage; |
| 25 | import de.uka.ipd.sdq.pcm.core.entity.EntityPackage; |
| 26 | import de.uka.ipd.sdq.pcm.seff.seff_performance.Seff_performancePackage; |
| 27 | |
| 28 | /** |
| 29 | * <!-- begin-user-doc --> |
| 30 | * An implementation of the model <b>Package</b>. |
| 31 | * <!-- end-user-doc --> |
| 32 | * @generated |
| 33 | */ |
| 34 | public class ComputedAllocationPackageImpl extends EPackageImpl implements ComputedAllocationPackage { |
| 35 | /** |
| 36 | * <!-- begin-user-doc --> |
| 37 | * <!-- end-user-doc --> |
| 38 | * @generated |
| 39 | */ |
| 40 | public static final String copyright = "Copyright 2006, SDQ Group, University Karlsruhe (TH)"; |
| 41 | |
| 42 | /** |
| 43 | * <!-- begin-user-doc --> |
| 44 | * <!-- end-user-doc --> |
| 45 | * @generated |
| 46 | */ |
| 47 | private EClass computedAllocationContextEClass = null; |
| 48 | |
| 49 | /** |
| 50 | * <!-- begin-user-doc --> |
| 51 | * <!-- end-user-doc --> |
| 52 | * @generated |
| 53 | */ |
| 54 | private EClass resourceDemandEClass = null; |
| 55 | |
| 56 | /** |
| 57 | * <!-- begin-user-doc --> |
| 58 | * <!-- end-user-doc --> |
| 59 | * @generated |
| 60 | */ |
| 61 | private EClass computedAllocationEClass = null; |
| 62 | |
| 63 | /** |
| 64 | * Creates an instance of the model <b>Package</b>, registered with |
| 65 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package |
| 66 | * package URI value. |
| 67 | * <p>Note: the correct way to create the package is via the static |
| 68 | * factory method {@link #init init()}, which also performs |
| 69 | * initialization of the package, or returns the registered package, |
| 70 | * if one already exists. |
| 71 | * <!-- begin-user-doc --> |
| 72 | * <!-- end-user-doc --> |
| 73 | * @see org.eclipse.emf.ecore.EPackage.Registry |
| 74 | * @see de.uka.ipd.sdq.context.computed_allocation.ComputedAllocationPackage#eNS_URI |
| 75 | * @see #init() |
| 76 | * @generated |
| 77 | */ |
| 78 | private ComputedAllocationPackageImpl() { |
| 79 | super(eNS_URI, ComputedAllocationFactory.eINSTANCE); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * <!-- begin-user-doc --> |
| 84 | * <!-- end-user-doc --> |
| 85 | * @generated |
| 86 | */ |
| 87 | private static boolean isInited = false; |
| 88 | |
| 89 | /** |
| 90 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
| 91 | * |
| 92 | * <p>This method is used to initialize {@link ComputedAllocationPackage#eINSTANCE} when that field is accessed. |
| 93 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
| 94 | * <!-- begin-user-doc --> |
| 95 | * <!-- end-user-doc --> |
| 96 | * @see #eNS_URI |
| 97 | * @see #createPackageContents() |
| 98 | * @see #initializePackageContents() |
| 99 | * @generated |
| 100 | */ |
| 101 | public static ComputedAllocationPackage init() { |
| 102 | if (isInited) return (ComputedAllocationPackage)EPackage.Registry.INSTANCE.getEPackage(ComputedAllocationPackage.eNS_URI); |
| 103 | |
| 104 | // Obtain or create and register package |
| 105 | ComputedAllocationPackageImpl theComputedAllocationPackage = (ComputedAllocationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ComputedAllocationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ComputedAllocationPackageImpl()); |
| 106 | |
| 107 | isInited = true; |
| 108 | |
| 109 | // Initialize simple dependencies |
| 110 | PcmPackage.eINSTANCE.eClass(); |
| 111 | |
| 112 | // Obtain or create and register interdependencies |
| 113 | ComputedUsagePackageImpl theComputedUsagePackage = (ComputedUsagePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ComputedUsagePackage.eNS_URI) instanceof ComputedUsagePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ComputedUsagePackage.eNS_URI) : ComputedUsagePackage.eINSTANCE); |
| 114 | AggregatedUsageContextPackageImpl theAggregatedUsageContextPackage = (AggregatedUsageContextPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(AggregatedUsageContextPackage.eNS_URI) instanceof AggregatedUsageContextPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(AggregatedUsageContextPackage.eNS_URI) : AggregatedUsageContextPackage.eINSTANCE); |
| 115 | |
| 116 | // Create package meta-data objects |
| 117 | theComputedAllocationPackage.createPackageContents(); |
| 118 | theComputedUsagePackage.createPackageContents(); |
| 119 | theAggregatedUsageContextPackage.createPackageContents(); |
| 120 | |
| 121 | // Initialize created meta-data |
| 122 | theComputedAllocationPackage.initializePackageContents(); |
| 123 | theComputedUsagePackage.initializePackageContents(); |
| 124 | theAggregatedUsageContextPackage.initializePackageContents(); |
| 125 | |
| 126 | // Mark meta-data to indicate it can't be changed |
| 127 | theComputedAllocationPackage.freeze(); |
| 128 | |
| 129 | |
| 130 | // Update the registry and return the package |
| 131 | EPackage.Registry.INSTANCE.put(ComputedAllocationPackage.eNS_URI, theComputedAllocationPackage); |
| 132 | return theComputedAllocationPackage; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * <!-- begin-user-doc --> |
| 137 | * <!-- end-user-doc --> |
| 138 | * @generated |
| 139 | */ |
| 140 | public EClass getComputedAllocationContext() { |
| 141 | return computedAllocationContextEClass; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * <!-- begin-user-doc --> |
| 146 | * <!-- end-user-doc --> |
| 147 | * @generated |
| 148 | */ |
| 149 | public EReference getComputedAllocationContext_ResourceDemands_ComputedAllocationContext() { |
| 150 | return (EReference)computedAllocationContextEClass.getEStructuralFeatures().get(0); |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * <!-- begin-user-doc --> |
| 155 | * <!-- end-user-doc --> |
| 156 | * @generated |
| 157 | */ |
| 158 | public EReference getComputedAllocationContext_UsageContext_ComputedAllocationContext() { |
| 159 | return (EReference)computedAllocationContextEClass.getEStructuralFeatures().get(1); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * <!-- begin-user-doc --> |
| 164 | * <!-- end-user-doc --> |
| 165 | * @generated |
| 166 | */ |
| 167 | public EReference getComputedAllocationContext_AllocationContext_ComputedAllocationContext() { |
| 168 | return (EReference)computedAllocationContextEClass.getEStructuralFeatures().get(2); |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * <!-- begin-user-doc --> |
| 173 | * <!-- end-user-doc --> |
| 174 | * @generated |
| 175 | */ |
| 176 | public EClass getResourceDemand() { |
| 177 | return resourceDemandEClass; |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * <!-- begin-user-doc --> |
| 182 | * <!-- end-user-doc --> |
| 183 | * @generated |
| 184 | */ |
| 185 | public EReference getResourceDemand_ParametricResourceDemand_ResourceDemand() { |
| 186 | return (EReference)resourceDemandEClass.getEStructuralFeatures().get(0); |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * <!-- begin-user-doc --> |
| 191 | * <!-- end-user-doc --> |
| 192 | * @generated |
| 193 | */ |
| 194 | public EReference getResourceDemand_Specification_ResourceDemand() { |
| 195 | return (EReference)resourceDemandEClass.getEStructuralFeatures().get(1); |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * <!-- begin-user-doc --> |
| 200 | * <!-- end-user-doc --> |
| 201 | * @generated |
| 202 | */ |
| 203 | public EClass getComputedAllocation() { |
| 204 | return computedAllocationEClass; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * <!-- begin-user-doc --> |
| 209 | * <!-- end-user-doc --> |
| 210 | * @generated |
| 211 | */ |
| 212 | public EReference getComputedAllocation_ComputedAllocationContexts_ComputedAllocation() { |
| 213 | return (EReference)computedAllocationEClass.getEStructuralFeatures().get(0); |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * <!-- begin-user-doc --> |
| 218 | * <!-- end-user-doc --> |
| 219 | * @generated |
| 220 | */ |
| 221 | public ComputedAllocationFactory getComputedAllocationFactory() { |
| 222 | return (ComputedAllocationFactory)getEFactoryInstance(); |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * <!-- begin-user-doc --> |
| 227 | * <!-- end-user-doc --> |
| 228 | * @generated |
| 229 | */ |
| 230 | private boolean isCreated = false; |
| 231 | |
| 232 | /** |
| 233 | * Creates the meta-model objects for the package. This method is |
| 234 | * guarded to have no affect on any invocation but its first. |
| 235 | * <!-- begin-user-doc --> |
| 236 | * <!-- end-user-doc --> |
| 237 | * @generated |
| 238 | */ |
| 239 | public void createPackageContents() { |
| 240 | if (isCreated) return; |
| 241 | isCreated = true; |
| 242 | |
| 243 | // Create classes and their features |
| 244 | computedAllocationContextEClass = createEClass(COMPUTED_ALLOCATION_CONTEXT); |
| 245 | createEReference(computedAllocationContextEClass, COMPUTED_ALLOCATION_CONTEXT__RESOURCE_DEMANDS_COMPUTED_ALLOCATION_CONTEXT); |
| 246 | createEReference(computedAllocationContextEClass, COMPUTED_ALLOCATION_CONTEXT__USAGE_CONTEXT_COMPUTED_ALLOCATION_CONTEXT); |
| 247 | createEReference(computedAllocationContextEClass, COMPUTED_ALLOCATION_CONTEXT__ALLOCATION_CONTEXT_COMPUTED_ALLOCATION_CONTEXT); |
| 248 | |
| 249 | resourceDemandEClass = createEClass(RESOURCE_DEMAND); |
| 250 | createEReference(resourceDemandEClass, RESOURCE_DEMAND__PARAMETRIC_RESOURCE_DEMAND_RESOURCE_DEMAND); |
| 251 | createEReference(resourceDemandEClass, RESOURCE_DEMAND__SPECIFICATION_RESOURCE_DEMAND); |
| 252 | |
| 253 | computedAllocationEClass = createEClass(COMPUTED_ALLOCATION); |
| 254 | createEReference(computedAllocationEClass, COMPUTED_ALLOCATION__COMPUTED_ALLOCATION_CONTEXTS_COMPUTED_ALLOCATION); |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * <!-- begin-user-doc --> |
| 259 | * <!-- end-user-doc --> |
| 260 | * @generated |
| 261 | */ |
| 262 | private boolean isInitialized = false; |
| 263 | |
| 264 | /** |
| 265 | * Complete the initialization of the package and its meta-model. This |
| 266 | * method is guarded to have no affect on any invocation but its first. |
| 267 | * <!-- begin-user-doc --> |
| 268 | * <!-- end-user-doc --> |
| 269 | * @generated |
| 270 | */ |
| 271 | public void initializePackageContents() { |
| 272 | if (isInitialized) return; |
| 273 | isInitialized = true; |
| 274 | |
| 275 | // Initialize package |
| 276 | setName(eNAME); |
| 277 | setNsPrefix(eNS_PREFIX); |
| 278 | setNsURI(eNS_URI); |
| 279 | |
| 280 | // Obtain other dependent packages |
| 281 | EntityPackage theEntityPackage = (EntityPackage)EPackage.Registry.INSTANCE.getEPackage(EntityPackage.eNS_URI); |
| 282 | ComputedUsagePackage theComputedUsagePackage = (ComputedUsagePackage)EPackage.Registry.INSTANCE.getEPackage(ComputedUsagePackage.eNS_URI); |
| 283 | AllocationPackage theAllocationPackage = (AllocationPackage)EPackage.Registry.INSTANCE.getEPackage(AllocationPackage.eNS_URI); |
| 284 | Seff_performancePackage thePerformancePackage = (Seff_performancePackage)EPackage.Registry.INSTANCE.getEPackage(Seff_performancePackage.eNS_URI); |
| 285 | CorePackage theCorePackage = (CorePackage)EPackage.Registry.INSTANCE.getEPackage(CorePackage.eNS_URI); |
| 286 | |
| 287 | // Create type parameters |
| 288 | |
| 289 | // Set bounds for type parameters |
| 290 | |
| 291 | // Add supertypes to classes |
| 292 | computedAllocationContextEClass.getESuperTypes().add(theEntityPackage.getEntity()); |
| 293 | |
| 294 | // Initialize classes and features; add operations and parameters |
| 295 | initEClass(computedAllocationContextEClass, ComputedAllocationContext.class, "ComputedAllocationContext", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| 296 | initEReference(getComputedAllocationContext_ResourceDemands_ComputedAllocationContext(), this.getResourceDemand(), null, "resourceDemands_ComputedAllocationContext", null, 0, -1, ComputedAllocationContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 297 | initEReference(getComputedAllocationContext_UsageContext_ComputedAllocationContext(), theComputedUsagePackage.getComputedUsageContext(), null, "usageContext_ComputedAllocationContext", null, 1, 1, ComputedAllocationContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 298 | initEReference(getComputedAllocationContext_AllocationContext_ComputedAllocationContext(), theAllocationPackage.getAllocationContext(), null, "allocationContext_ComputedAllocationContext", null, 1, 1, ComputedAllocationContext.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 299 | |
| 300 | initEClass(resourceDemandEClass, ResourceDemand.class, "ResourceDemand", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| 301 | initEReference(getResourceDemand_ParametricResourceDemand_ResourceDemand(), thePerformancePackage.getParametricResourceDemand(), null, "parametricResourceDemand_ResourceDemand", null, 1, 1, ResourceDemand.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 302 | initEReference(getResourceDemand_Specification_ResourceDemand(), theCorePackage.getPCMRandomVariable(), null, "specification_ResourceDemand", null, 1, 1, ResourceDemand.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 303 | |
| 304 | initEClass(computedAllocationEClass, ComputedAllocation.class, "ComputedAllocation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
| 305 | initEReference(getComputedAllocation_ComputedAllocationContexts_ComputedAllocation(), this.getComputedAllocationContext(), null, "computedAllocationContexts_ComputedAllocation", null, 0, -1, ComputedAllocation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); |
| 306 | |
| 307 | // Create resource |
| 308 | createResource(eNS_URI); |
| 309 | } |
| 310 | |
| 311 | } //ComputedAllocationPackageImpl |