1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.units.impl; |
8 | |
9 | import de.uka.ipd.sdq.units.*; |
10 | |
11 | import org.eclipse.emf.ecore.EClass; |
12 | import org.eclipse.emf.ecore.EObject; |
13 | import org.eclipse.emf.ecore.EPackage; |
14 | |
15 | import org.eclipse.emf.ecore.impl.EFactoryImpl; |
16 | |
17 | import org.eclipse.emf.ecore.plugin.EcorePlugin; |
18 | |
19 | /** |
20 | * <!-- begin-user-doc --> |
21 | * An implementation of the model <b>Factory</b>. |
22 | * <!-- end-user-doc --> |
23 | * @generated |
24 | */ |
25 | public class UnitsFactoryImpl extends EFactoryImpl implements UnitsFactory { |
26 | /** |
27 | * <!-- begin-user-doc --> |
28 | * <!-- end-user-doc --> |
29 | * @generated |
30 | */ |
31 | public static final String copyright = "Copyright 2007-2009, SDQ, IPD, U Karlsruhe"; |
32 | |
33 | /** |
34 | * Creates the default factory implementation. |
35 | * <!-- begin-user-doc --> |
36 | * <!-- end-user-doc --> |
37 | * @generated |
38 | */ |
39 | public static UnitsFactory init() { |
40 | try { |
41 | UnitsFactory theUnitsFactory = (UnitsFactory)EPackage.Registry.INSTANCE.getEFactory("http://sdq.ipd.uka.de/Units/1.0"); |
42 | if (theUnitsFactory != null) { |
43 | return theUnitsFactory; |
44 | } |
45 | } |
46 | catch (Exception exception) { |
47 | EcorePlugin.INSTANCE.log(exception); |
48 | } |
49 | return new UnitsFactoryImpl(); |
50 | } |
51 | |
52 | /** |
53 | * Creates an instance of the factory. |
54 | * <!-- begin-user-doc --> |
55 | * <!-- end-user-doc --> |
56 | * @generated |
57 | */ |
58 | public UnitsFactoryImpl() { |
59 | super(); |
60 | } |
61 | |
62 | /** |
63 | * <!-- begin-user-doc --> |
64 | * <!-- end-user-doc --> |
65 | * @generated |
66 | */ |
67 | @Override |
68 | public EObject create(EClass eClass) { |
69 | switch (eClass.getClassifierID()) { |
70 | case UnitsPackage.BASE_UNIT: return createBaseUnit(); |
71 | case UnitsPackage.UNIT_REPOSITORY: return createUnitRepository(); |
72 | case UnitsPackage.UNIT_MULTIPLICATION: return createUnitMultiplication(); |
73 | case UnitsPackage.UNIT_POWER: return createUnitPower(); |
74 | case UnitsPackage.UNIT_LITERAL: return createUnitLiteral(); |
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 BaseUnit createBaseUnit() { |
86 | BaseUnitImpl baseUnit = new BaseUnitImpl(); |
87 | return baseUnit; |
88 | } |
89 | |
90 | /** |
91 | * <!-- begin-user-doc --> |
92 | * <!-- end-user-doc --> |
93 | * @generated |
94 | */ |
95 | public UnitRepository createUnitRepository() { |
96 | UnitRepositoryImpl unitRepository = new UnitRepositoryImpl(); |
97 | return unitRepository; |
98 | } |
99 | |
100 | /** |
101 | * <!-- begin-user-doc --> |
102 | * <!-- end-user-doc --> |
103 | * @generated |
104 | */ |
105 | public UnitMultiplication createUnitMultiplication() { |
106 | UnitMultiplicationImpl unitMultiplication = new UnitMultiplicationImpl(); |
107 | return unitMultiplication; |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | public UnitPower createUnitPower() { |
116 | UnitPowerImpl unitPower = new UnitPowerImpl(); |
117 | return unitPower; |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | public UnitLiteral createUnitLiteral() { |
126 | UnitLiteralImpl unitLiteral = new UnitLiteralImpl(); |
127 | return unitLiteral; |
128 | } |
129 | |
130 | /** |
131 | * <!-- begin-user-doc --> |
132 | * <!-- end-user-doc --> |
133 | * @generated |
134 | */ |
135 | public UnitsPackage getUnitsPackage() { |
136 | return (UnitsPackage)getEPackage(); |
137 | } |
138 | |
139 | /** |
140 | * <!-- begin-user-doc --> |
141 | * <!-- end-user-doc --> |
142 | * @deprecated |
143 | * @generated |
144 | */ |
145 | @Deprecated |
146 | public static UnitsPackage getPackage() { |
147 | return UnitsPackage.eINSTANCE; |
148 | } |
149 | |
150 | } //UnitsFactoryImpl |