1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.spa.resourcemodel.impl; |
8 | |
9 | import org.eclipse.emf.ecore.EClass; |
10 | import org.eclipse.emf.ecore.EObject; |
11 | import org.eclipse.emf.ecore.EPackage; |
12 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
13 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
14 | |
15 | import de.uka.ipd.sdq.spa.resourcemodel.AlternativeResourceUsage; |
16 | import de.uka.ipd.sdq.spa.resourcemodel.DelayResource; |
17 | import de.uka.ipd.sdq.spa.resourcemodel.Option; |
18 | import de.uka.ipd.sdq.spa.resourcemodel.PassiveResource; |
19 | import de.uka.ipd.sdq.spa.resourcemodel.ProcessingResource; |
20 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceModelFactory; |
21 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceModelPackage; |
22 | import de.uka.ipd.sdq.spa.resourcemodel.ResourceUsage; |
23 | import de.uka.ipd.sdq.spa.resourcemodel.SequentialResourceUsage; |
24 | |
25 | /** |
26 | * <!-- begin-user-doc --> |
27 | * An implementation of the model <b>Factory</b>. |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public class ResourceModelFactoryImpl extends EFactoryImpl implements ResourceModelFactory { |
32 | /** |
33 | * Creates the default factory implementation. |
34 | * <!-- begin-user-doc --> |
35 | * <!-- end-user-doc --> |
36 | * @generated |
37 | */ |
38 | public static ResourceModelFactory init() { |
39 | try { |
40 | ResourceModelFactory theResourceModelFactory = (ResourceModelFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/ResourceModel/1.0"); |
41 | if (theResourceModelFactory != null) { |
42 | return theResourceModelFactory; |
43 | } |
44 | } |
45 | catch (Exception exception) { |
46 | EcorePlugin.INSTANCE.log(exception); |
47 | } |
48 | return new ResourceModelFactoryImpl(); |
49 | } |
50 | |
51 | /** |
52 | * Creates an instance of the factory. |
53 | * <!-- begin-user-doc --> |
54 | * <!-- end-user-doc --> |
55 | * @generated |
56 | */ |
57 | public ResourceModelFactoryImpl() { |
58 | super(); |
59 | } |
60 | |
61 | /** |
62 | * <!-- begin-user-doc --> |
63 | * <!-- end-user-doc --> |
64 | * @generated |
65 | */ |
66 | public EObject create(EClass eClass) { |
67 | switch (eClass.getClassifierID()) { |
68 | case ResourceModelPackage.SEQUENTIAL_RESOURCE_USAGE: return createSequentialResourceUsage(); |
69 | case ResourceModelPackage.ALTERNATIVE_RESOURCE_USAGE: return createAlternativeResourceUsage(); |
70 | case ResourceModelPackage.RESOURCE_USAGE: return createResourceUsage(); |
71 | case ResourceModelPackage.PASSIVE_RESOURCE: return createPassiveResource(); |
72 | case ResourceModelPackage.PROCESSING_RESOURCE: return createProcessingResource(); |
73 | case ResourceModelPackage.DELAY_RESOURCE: return createDelayResource(); |
74 | case ResourceModelPackage.OPTION: return createOption(); |
75 | default: |
76 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); |
77 | } |
78 | } |
79 | |
80 | /** |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @generated |
84 | */ |
85 | public SequentialResourceUsage createSequentialResourceUsage() { |
86 | SequentialResourceUsageImpl sequentialResourceUsage = new SequentialResourceUsageImpl(); |
87 | return sequentialResourceUsage; |
88 | } |
89 | |
90 | /** |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | public AlternativeResourceUsage createAlternativeResourceUsage() { |
96 | AlternativeResourceUsageImpl alternativeResourceUsage = new AlternativeResourceUsageImpl(); |
97 | return alternativeResourceUsage; |
98 | } |
99 | |
100 | /** |
101 | * <!-- begin-user-doc --> |
102 | * <!-- end-user-doc --> |
103 | * @generated |
104 | */ |
105 | public ResourceUsage createResourceUsage() { |
106 | ResourceUsageImpl resourceUsage = new ResourceUsageImpl(); |
107 | return resourceUsage; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public PassiveResource createPassiveResource() { |
116 | PassiveResourceImpl passiveResource = new PassiveResourceImpl(); |
117 | return passiveResource; |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | public ProcessingResource createProcessingResource() { |
126 | ProcessingResourceImpl processingResource = new ProcessingResourceImpl(); |
127 | return processingResource; |
128 | } |
129 | |
130 | /** |
131 | * <!-- begin-user-doc --> |
132 | * <!-- end-user-doc --> |
133 | * @generated |
134 | */ |
135 | public DelayResource createDelayResource() { |
136 | DelayResourceImpl delayResource = new DelayResourceImpl(); |
137 | return delayResource; |
138 | } |
139 | |
140 | /** |
141 | * <!-- begin-user-doc --> |
142 | * <!-- end-user-doc --> |
143 | * @generated |
144 | */ |
145 | public Option createOption() { |
146 | OptionImpl option = new OptionImpl(); |
147 | return option; |
148 | } |
149 | |
150 | /** |
151 | * <!-- begin-user-doc --> |
152 | * <!-- end-user-doc --> |
153 | * @generated |
154 | */ |
155 | public ResourceModelPackage getResourceModelPackage() { |
156 | return (ResourceModelPackage)getEPackage(); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @deprecated |
163 | * @generated |
164 | */ |
165 | public static ResourceModelPackage getPackage() { |
166 | return ResourceModelPackage.eINSTANCE; |
167 | } |
168 | |
169 | } //ResourceModelFactoryImpl |