diff options
author | 2021-06-27 14:22:40 +0200 | |
---|---|---|
committer | 2021-06-27 14:22:40 +0200 | |
commit | 07719e927f9d398765e661c84fd8778cefb39083 (patch) | |
tree | 9652080f7e580f09a0763a3e258348dea6e02684 /language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java | |
parent | Add enum support (diff) | |
download | refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.gz refinery-07719e927f9d398765e661c84fd8778cefb39083.tar.zst refinery-07719e927f9d398765e661c84fd8778cefb39083.zip |
Simplify project layout
Diffstat (limited to 'language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java')
-rw-r--r-- | language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java | 353 |
1 files changed, 353 insertions, 0 deletions
diff --git a/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java b/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java new file mode 100644 index 00000000..2f4144b9 --- /dev/null +++ b/language-model/src/main/emf-gen/org/eclipse/viatra/solver/language/model/problem/impl/ProblemFactoryImpl.java | |||
@@ -0,0 +1,353 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package org.eclipse.viatra.solver.language.model.problem.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EDataType; | ||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.emf.ecore.EPackage; | ||
9 | |||
10 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
11 | |||
12 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
13 | |||
14 | import org.eclipse.viatra.solver.language.model.problem.*; | ||
15 | |||
16 | /** | ||
17 | * <!-- begin-user-doc --> | ||
18 | * An implementation of the model <b>Factory</b>. | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | public class ProblemFactoryImpl extends EFactoryImpl implements ProblemFactory { | ||
23 | /** | ||
24 | * Creates the default factory implementation. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | public static ProblemFactory init() { | ||
30 | try { | ||
31 | ProblemFactory theProblemFactory = (ProblemFactory) EPackage.Registry.INSTANCE | ||
32 | .getEFactory(ProblemPackage.eNS_URI); | ||
33 | if (theProblemFactory != null) { | ||
34 | return theProblemFactory; | ||
35 | } | ||
36 | } catch (Exception exception) { | ||
37 | EcorePlugin.INSTANCE.log(exception); | ||
38 | } | ||
39 | return new ProblemFactoryImpl(); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * Creates an instance of the factory. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @generated | ||
47 | */ | ||
48 | public ProblemFactoryImpl() { | ||
49 | super(); | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | @Override | ||
58 | public EObject create(EClass eClass) { | ||
59 | switch (eClass.getClassifierID()) { | ||
60 | case ProblemPackage.PROBLEM: | ||
61 | return createProblem(); | ||
62 | case ProblemPackage.CLASS_DECLARATION: | ||
63 | return createClassDeclaration(); | ||
64 | case ProblemPackage.REFERENCE_DECLARATION: | ||
65 | return createReferenceDeclaration(); | ||
66 | case ProblemPackage.PREDICATE_DEFINITION: | ||
67 | return createPredicateDefinition(); | ||
68 | case ProblemPackage.PARAMETER: | ||
69 | return createParameter(); | ||
70 | case ProblemPackage.CONJUNCTION: | ||
71 | return createConjunction(); | ||
72 | case ProblemPackage.ATOM: | ||
73 | return createAtom(); | ||
74 | case ProblemPackage.IMPLICIT_VARIABLE: | ||
75 | return createImplicitVariable(); | ||
76 | case ProblemPackage.NEGATIVE_LITERAL: | ||
77 | return createNegativeLiteral(); | ||
78 | case ProblemPackage.ASSERTION: | ||
79 | return createAssertion(); | ||
80 | case ProblemPackage.NODE: | ||
81 | return createNode(); | ||
82 | case ProblemPackage.SCOPE_DECLARATION: | ||
83 | return createScopeDeclaration(); | ||
84 | case ProblemPackage.TYPE_SCOPE: | ||
85 | return createTypeScope(); | ||
86 | case ProblemPackage.RANGE_MULTIPLICITY: | ||
87 | return createRangeMultiplicity(); | ||
88 | case ProblemPackage.EXACT_MULTIPLICITY: | ||
89 | return createExactMultiplicity(); | ||
90 | case ProblemPackage.UNBOUNDED_MULTIPLICITY: | ||
91 | return createUnboundedMultiplicity(); | ||
92 | case ProblemPackage.ARGUMENT: | ||
93 | return createArgument(); | ||
94 | case ProblemPackage.ENUM_DECLARATION: | ||
95 | return createEnumDeclaration(); | ||
96 | default: | ||
97 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
98 | } | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @generated | ||
105 | */ | ||
106 | @Override | ||
107 | public Object createFromString(EDataType eDataType, String initialValue) { | ||
108 | switch (eDataType.getClassifierID()) { | ||
109 | case ProblemPackage.LOGIC_VALUE: | ||
110 | return createLogicValueFromString(eDataType, initialValue); | ||
111 | default: | ||
112 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); | ||
113 | } | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * <!-- begin-user-doc --> | ||
118 | * <!-- end-user-doc --> | ||
119 | * @generated | ||
120 | */ | ||
121 | @Override | ||
122 | public String convertToString(EDataType eDataType, Object instanceValue) { | ||
123 | switch (eDataType.getClassifierID()) { | ||
124 | case ProblemPackage.LOGIC_VALUE: | ||
125 | return convertLogicValueToString(eDataType, instanceValue); | ||
126 | default: | ||
127 | throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | public Problem createProblem() { | ||
137 | ProblemImpl problem = new ProblemImpl(); | ||
138 | return problem; | ||
139 | } | ||
140 | |||
141 | /** | ||
142 | * <!-- begin-user-doc --> | ||
143 | * <!-- end-user-doc --> | ||
144 | * @generated | ||
145 | */ | ||
146 | public ClassDeclaration createClassDeclaration() { | ||
147 | ClassDeclarationImpl classDeclaration = new ClassDeclarationImpl(); | ||
148 | return classDeclaration; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | public ReferenceDeclaration createReferenceDeclaration() { | ||
157 | ReferenceDeclarationImpl referenceDeclaration = new ReferenceDeclarationImpl(); | ||
158 | return referenceDeclaration; | ||
159 | } | ||
160 | |||
161 | /** | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | */ | ||
166 | public PredicateDefinition createPredicateDefinition() { | ||
167 | PredicateDefinitionImpl predicateDefinition = new PredicateDefinitionImpl(); | ||
168 | return predicateDefinition; | ||
169 | } | ||
170 | |||
171 | /** | ||
172 | * <!-- begin-user-doc --> | ||
173 | * <!-- end-user-doc --> | ||
174 | * @generated | ||
175 | */ | ||
176 | public Parameter createParameter() { | ||
177 | ParameterImpl parameter = new ParameterImpl(); | ||
178 | return parameter; | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | public Conjunction createConjunction() { | ||
187 | ConjunctionImpl conjunction = new ConjunctionImpl(); | ||
188 | return conjunction; | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * <!-- begin-user-doc --> | ||
193 | * <!-- end-user-doc --> | ||
194 | * @generated | ||
195 | */ | ||
196 | public Atom createAtom() { | ||
197 | AtomImpl atom = new AtomImpl(); | ||
198 | return atom; | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * <!-- begin-user-doc --> | ||
203 | * <!-- end-user-doc --> | ||
204 | * @generated | ||
205 | */ | ||
206 | public ImplicitVariable createImplicitVariable() { | ||
207 | ImplicitVariableImpl implicitVariable = new ImplicitVariableImpl(); | ||
208 | return implicitVariable; | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * <!-- begin-user-doc --> | ||
213 | * <!-- end-user-doc --> | ||
214 | * @generated | ||
215 | */ | ||
216 | public NegativeLiteral createNegativeLiteral() { | ||
217 | NegativeLiteralImpl negativeLiteral = new NegativeLiteralImpl(); | ||
218 | return negativeLiteral; | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * <!-- begin-user-doc --> | ||
223 | * <!-- end-user-doc --> | ||
224 | * @generated | ||
225 | */ | ||
226 | public Assertion createAssertion() { | ||
227 | AssertionImpl assertion = new AssertionImpl(); | ||
228 | return assertion; | ||
229 | } | ||
230 | |||
231 | /** | ||
232 | * <!-- begin-user-doc --> | ||
233 | * <!-- end-user-doc --> | ||
234 | * @generated | ||
235 | */ | ||
236 | public Node createNode() { | ||
237 | NodeImpl node = new NodeImpl(); | ||
238 | return node; | ||
239 | } | ||
240 | |||
241 | /** | ||
242 | * <!-- begin-user-doc --> | ||
243 | * <!-- end-user-doc --> | ||
244 | * @generated | ||
245 | */ | ||
246 | public ScopeDeclaration createScopeDeclaration() { | ||
247 | ScopeDeclarationImpl scopeDeclaration = new ScopeDeclarationImpl(); | ||
248 | return scopeDeclaration; | ||
249 | } | ||
250 | |||
251 | /** | ||
252 | * <!-- begin-user-doc --> | ||
253 | * <!-- end-user-doc --> | ||
254 | * @generated | ||
255 | */ | ||
256 | public TypeScope createTypeScope() { | ||
257 | TypeScopeImpl typeScope = new TypeScopeImpl(); | ||
258 | return typeScope; | ||
259 | } | ||
260 | |||
261 | /** | ||
262 | * <!-- begin-user-doc --> | ||
263 | * <!-- end-user-doc --> | ||
264 | * @generated | ||
265 | */ | ||
266 | public RangeMultiplicity createRangeMultiplicity() { | ||
267 | RangeMultiplicityImpl rangeMultiplicity = new RangeMultiplicityImpl(); | ||
268 | return rangeMultiplicity; | ||
269 | } | ||
270 | |||
271 | /** | ||
272 | * <!-- begin-user-doc --> | ||
273 | * <!-- end-user-doc --> | ||
274 | * @generated | ||
275 | */ | ||
276 | public ExactMultiplicity createExactMultiplicity() { | ||
277 | ExactMultiplicityImpl exactMultiplicity = new ExactMultiplicityImpl(); | ||
278 | return exactMultiplicity; | ||
279 | } | ||
280 | |||
281 | /** | ||
282 | * <!-- begin-user-doc --> | ||
283 | * <!-- end-user-doc --> | ||
284 | * @generated | ||
285 | */ | ||
286 | public UnboundedMultiplicity createUnboundedMultiplicity() { | ||
287 | UnboundedMultiplicityImpl unboundedMultiplicity = new UnboundedMultiplicityImpl(); | ||
288 | return unboundedMultiplicity; | ||
289 | } | ||
290 | |||
291 | /** | ||
292 | * <!-- begin-user-doc --> | ||
293 | * <!-- end-user-doc --> | ||
294 | * @generated | ||
295 | */ | ||
296 | public Argument createArgument() { | ||
297 | ArgumentImpl argument = new ArgumentImpl(); | ||
298 | return argument; | ||
299 | } | ||
300 | |||
301 | /** | ||
302 | * <!-- begin-user-doc --> | ||
303 | * <!-- end-user-doc --> | ||
304 | * @generated | ||
305 | */ | ||
306 | public EnumDeclaration createEnumDeclaration() { | ||
307 | EnumDeclarationImpl enumDeclaration = new EnumDeclarationImpl(); | ||
308 | return enumDeclaration; | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * <!-- begin-user-doc --> | ||
313 | * <!-- end-user-doc --> | ||
314 | * @generated | ||
315 | */ | ||
316 | public LogicValue createLogicValueFromString(EDataType eDataType, String initialValue) { | ||
317 | LogicValue result = LogicValue.get(initialValue); | ||
318 | if (result == null) | ||
319 | throw new IllegalArgumentException( | ||
320 | "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); | ||
321 | return result; | ||
322 | } | ||
323 | |||
324 | /** | ||
325 | * <!-- begin-user-doc --> | ||
326 | * <!-- end-user-doc --> | ||
327 | * @generated | ||
328 | */ | ||
329 | public String convertLogicValueToString(EDataType eDataType, Object instanceValue) { | ||
330 | return instanceValue == null ? null : instanceValue.toString(); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * <!-- begin-user-doc --> | ||
335 | * <!-- end-user-doc --> | ||
336 | * @generated | ||
337 | */ | ||
338 | public ProblemPackage getProblemPackage() { | ||
339 | return (ProblemPackage) getEPackage(); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * <!-- begin-user-doc --> | ||
344 | * <!-- end-user-doc --> | ||
345 | * @deprecated | ||
346 | * @generated | ||
347 | */ | ||
348 | @Deprecated | ||
349 | public static ProblemPackage getPackage() { | ||
350 | return ProblemPackage.eINSTANCE; | ||
351 | } | ||
352 | |||
353 | } //ProblemFactoryImpl | ||