diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
commit | c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e (patch) | |
tree | 0c2e212e4e95c1d2311629128641d5cd561210f3 /Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.gz VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.zst VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.zip |
Add PLEDGE case study files
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java | 569 |
1 files changed, 569 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java new file mode 100644 index 00000000..c1477d21 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv47.java | |||
@@ -0,0 +1,569 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/case.study.a.queries/src/queries/case_study_A.vql | ||
3 | */ | ||
4 | package queries; | ||
5 | |||
6 | import Taxation.Legal_Union_Record; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.emf.ecore.EDataType; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
43 | |||
44 | /** | ||
45 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
46 | * | ||
47 | * <p>Original source: | ||
48 | * <code><pre> | ||
49 | * pattern x_inv47(lur : Legal_Union_Record) { | ||
50 | * Legal_Union_Record.separation_cause(lur, ::NONE); | ||
51 | * Legal_Union_Record.end_year(lur, -1); | ||
52 | * } | ||
53 | * </pre></code> | ||
54 | * | ||
55 | * @see Matcher | ||
56 | * @see Match | ||
57 | * | ||
58 | */ | ||
59 | @SuppressWarnings("all") | ||
60 | public final class X_inv47 extends BaseGeneratedEMFQuerySpecification<X_inv47.Matcher> { | ||
61 | /** | ||
62 | * Pattern-specific match representation of the queries.x_inv47 pattern, | ||
63 | * to be used in conjunction with {@link Matcher}. | ||
64 | * | ||
65 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
66 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
67 | * usable to represent a match of the pattern in the result of a query, | ||
68 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
69 | * | ||
70 | * @see Matcher | ||
71 | * | ||
72 | */ | ||
73 | public static abstract class Match extends BasePatternMatch { | ||
74 | private Legal_Union_Record fLur; | ||
75 | |||
76 | private static List<String> parameterNames = makeImmutableList("lur"); | ||
77 | |||
78 | private Match(final Legal_Union_Record pLur) { | ||
79 | this.fLur = pLur; | ||
80 | } | ||
81 | |||
82 | @Override | ||
83 | public Object get(final String parameterName) { | ||
84 | switch(parameterName) { | ||
85 | case "lur": return this.fLur; | ||
86 | default: return null; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public Object get(final int index) { | ||
92 | switch(index) { | ||
93 | case 0: return this.fLur; | ||
94 | default: return null; | ||
95 | } | ||
96 | } | ||
97 | |||
98 | public Legal_Union_Record getLur() { | ||
99 | return this.fLur; | ||
100 | } | ||
101 | |||
102 | @Override | ||
103 | public boolean set(final String parameterName, final Object newValue) { | ||
104 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
105 | if ("lur".equals(parameterName) ) { | ||
106 | this.fLur = (Legal_Union_Record) newValue; | ||
107 | return true; | ||
108 | } | ||
109 | return false; | ||
110 | } | ||
111 | |||
112 | public void setLur(final Legal_Union_Record pLur) { | ||
113 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
114 | this.fLur = pLur; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public String patternName() { | ||
119 | return "queries.x_inv47"; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public List<String> parameterNames() { | ||
124 | return X_inv47.Match.parameterNames; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public Object[] toArray() { | ||
129 | return new Object[]{fLur}; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public X_inv47.Match toImmutable() { | ||
134 | return isMutable() ? newMatch(fLur) : this; | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public String prettyPrint() { | ||
139 | StringBuilder result = new StringBuilder(); | ||
140 | result.append("\"lur\"=" + prettyPrintValue(fLur)); | ||
141 | return result.toString(); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public int hashCode() { | ||
146 | return Objects.hash(fLur); | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public boolean equals(final Object obj) { | ||
151 | if (this == obj) | ||
152 | return true; | ||
153 | if (obj == null) { | ||
154 | return false; | ||
155 | } | ||
156 | if ((obj instanceof X_inv47.Match)) { | ||
157 | X_inv47.Match other = (X_inv47.Match) obj; | ||
158 | return Objects.equals(fLur, other.fLur); | ||
159 | } else { | ||
160 | // this should be infrequent | ||
161 | if (!(obj instanceof IPatternMatch)) { | ||
162 | return false; | ||
163 | } | ||
164 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
165 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
166 | } | ||
167 | } | ||
168 | |||
169 | @Override | ||
170 | public X_inv47 specification() { | ||
171 | return X_inv47.instance(); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * Returns an empty, mutable match. | ||
176 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
177 | * | ||
178 | * @return the empty match. | ||
179 | * | ||
180 | */ | ||
181 | public static X_inv47.Match newEmptyMatch() { | ||
182 | return new Mutable(null); | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * Returns a mutable (partial) match. | ||
187 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
188 | * | ||
189 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
190 | * @return the new, mutable (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static X_inv47.Match newMutableMatch(final Legal_Union_Record pLur) { | ||
194 | return new Mutable(pLur); | ||
195 | } | ||
196 | |||
197 | /** | ||
198 | * Returns a new (partial) match. | ||
199 | * This can be used e.g. to call the matcher with a partial match. | ||
200 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
201 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
202 | * @return the (partial) match object. | ||
203 | * | ||
204 | */ | ||
205 | public static X_inv47.Match newMatch(final Legal_Union_Record pLur) { | ||
206 | return new Immutable(pLur); | ||
207 | } | ||
208 | |||
209 | private static final class Mutable extends X_inv47.Match { | ||
210 | Mutable(final Legal_Union_Record pLur) { | ||
211 | super(pLur); | ||
212 | } | ||
213 | |||
214 | @Override | ||
215 | public boolean isMutable() { | ||
216 | return true; | ||
217 | } | ||
218 | } | ||
219 | |||
220 | private static final class Immutable extends X_inv47.Match { | ||
221 | Immutable(final Legal_Union_Record pLur) { | ||
222 | super(pLur); | ||
223 | } | ||
224 | |||
225 | @Override | ||
226 | public boolean isMutable() { | ||
227 | return false; | ||
228 | } | ||
229 | } | ||
230 | } | ||
231 | |||
232 | /** | ||
233 | * Generated pattern matcher API of the queries.x_inv47 pattern, | ||
234 | * providing pattern-specific query methods. | ||
235 | * | ||
236 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
237 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
238 | * | ||
239 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
240 | * | ||
241 | * <p>Original source: | ||
242 | * <code><pre> | ||
243 | * pattern x_inv47(lur : Legal_Union_Record) { | ||
244 | * Legal_Union_Record.separation_cause(lur, ::NONE); | ||
245 | * Legal_Union_Record.end_year(lur, -1); | ||
246 | * } | ||
247 | * </pre></code> | ||
248 | * | ||
249 | * @see Match | ||
250 | * @see X_inv47 | ||
251 | * | ||
252 | */ | ||
253 | public static class Matcher extends BaseMatcher<X_inv47.Match> { | ||
254 | /** | ||
255 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
256 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
257 | * | ||
258 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
259 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
260 | * | ||
261 | */ | ||
262 | public static X_inv47.Matcher on(final ViatraQueryEngine engine) { | ||
263 | // check if matcher already exists | ||
264 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
265 | if (matcher == null) { | ||
266 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
267 | } | ||
268 | return matcher; | ||
269 | } | ||
270 | |||
271 | /** | ||
272 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
273 | * @return an initialized matcher | ||
274 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
275 | * | ||
276 | */ | ||
277 | public static X_inv47.Matcher create() { | ||
278 | return new Matcher(); | ||
279 | } | ||
280 | |||
281 | private static final int POSITION_LUR = 0; | ||
282 | |||
283 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(X_inv47.Matcher.class); | ||
284 | |||
285 | /** | ||
286 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
287 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
288 | * | ||
289 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
290 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
291 | * | ||
292 | */ | ||
293 | private Matcher() { | ||
294 | super(querySpecification()); | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
299 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
300 | * @return matches represented as a Match object. | ||
301 | * | ||
302 | */ | ||
303 | public Collection<X_inv47.Match> getAllMatches(final Legal_Union_Record pLur) { | ||
304 | return rawStreamAllMatches(new Object[]{pLur}).collect(Collectors.toSet()); | ||
305 | } | ||
306 | |||
307 | /** | ||
308 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
309 | * </p> | ||
310 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
311 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
312 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
313 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
314 | * @return a stream of matches represented as a Match object. | ||
315 | * | ||
316 | */ | ||
317 | public Stream<X_inv47.Match> streamAllMatches(final Legal_Union_Record pLur) { | ||
318 | return rawStreamAllMatches(new Object[]{pLur}); | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
323 | * Neither determinism nor randomness of selection is guaranteed. | ||
324 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
325 | * @return a match represented as a Match object, or null if no match is found. | ||
326 | * | ||
327 | */ | ||
328 | public Optional<X_inv47.Match> getOneArbitraryMatch(final Legal_Union_Record pLur) { | ||
329 | return rawGetOneArbitraryMatch(new Object[]{pLur}); | ||
330 | } | ||
331 | |||
332 | /** | ||
333 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
334 | * under any possible substitution of the unspecified parameters (if any). | ||
335 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
336 | * @return true if the input is a valid (partial) match of the pattern. | ||
337 | * | ||
338 | */ | ||
339 | public boolean hasMatch(final Legal_Union_Record pLur) { | ||
340 | return rawHasMatch(new Object[]{pLur}); | ||
341 | } | ||
342 | |||
343 | /** | ||
344 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
345 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
346 | * @return the number of pattern matches found. | ||
347 | * | ||
348 | */ | ||
349 | public int countMatches(final Legal_Union_Record pLur) { | ||
350 | return rawCountMatches(new Object[]{pLur}); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
355 | * Neither determinism nor randomness of selection is guaranteed. | ||
356 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
357 | * @param processor the action that will process the selected match. | ||
358 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
359 | * | ||
360 | */ | ||
361 | public boolean forOneArbitraryMatch(final Legal_Union_Record pLur, final Consumer<? super X_inv47.Match> processor) { | ||
362 | return rawForOneArbitraryMatch(new Object[]{pLur}, processor); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Returns a new (partial) match. | ||
367 | * This can be used e.g. to call the matcher with a partial match. | ||
368 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
369 | * @param pLur the fixed value of pattern parameter lur, or null if not bound. | ||
370 | * @return the (partial) match object. | ||
371 | * | ||
372 | */ | ||
373 | public X_inv47.Match newMatch(final Legal_Union_Record pLur) { | ||
374 | return X_inv47.Match.newMatch(pLur); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Retrieve the set of values that occur in matches for lur. | ||
379 | * @return the Set of all values or empty set if there are no matches | ||
380 | * | ||
381 | */ | ||
382 | protected Stream<Legal_Union_Record> rawStreamAllValuesOflur(final Object[] parameters) { | ||
383 | return rawStreamAllValues(POSITION_LUR, parameters).map(Legal_Union_Record.class::cast); | ||
384 | } | ||
385 | |||
386 | /** | ||
387 | * Retrieve the set of values that occur in matches for lur. | ||
388 | * @return the Set of all values or empty set if there are no matches | ||
389 | * | ||
390 | */ | ||
391 | public Set<Legal_Union_Record> getAllValuesOflur() { | ||
392 | return rawStreamAllValuesOflur(emptyArray()).collect(Collectors.toSet()); | ||
393 | } | ||
394 | |||
395 | /** | ||
396 | * Retrieve the set of values that occur in matches for lur. | ||
397 | * @return the Set of all values or empty set if there are no matches | ||
398 | * | ||
399 | */ | ||
400 | public Stream<Legal_Union_Record> streamAllValuesOflur() { | ||
401 | return rawStreamAllValuesOflur(emptyArray()); | ||
402 | } | ||
403 | |||
404 | @Override | ||
405 | protected X_inv47.Match tupleToMatch(final Tuple t) { | ||
406 | try { | ||
407 | return X_inv47.Match.newMatch((Legal_Union_Record) t.get(POSITION_LUR)); | ||
408 | } catch(ClassCastException e) { | ||
409 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
410 | return null; | ||
411 | } | ||
412 | } | ||
413 | |||
414 | @Override | ||
415 | protected X_inv47.Match arrayToMatch(final Object[] match) { | ||
416 | try { | ||
417 | return X_inv47.Match.newMatch((Legal_Union_Record) match[POSITION_LUR]); | ||
418 | } catch(ClassCastException e) { | ||
419 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
420 | return null; | ||
421 | } | ||
422 | } | ||
423 | |||
424 | @Override | ||
425 | protected X_inv47.Match arrayToMatchMutable(final Object[] match) { | ||
426 | try { | ||
427 | return X_inv47.Match.newMutableMatch((Legal_Union_Record) match[POSITION_LUR]); | ||
428 | } catch(ClassCastException e) { | ||
429 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
430 | return null; | ||
431 | } | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * @return the singleton instance of the query specification of this pattern | ||
436 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
437 | * | ||
438 | */ | ||
439 | public static IQuerySpecification<X_inv47.Matcher> querySpecification() { | ||
440 | return X_inv47.instance(); | ||
441 | } | ||
442 | } | ||
443 | |||
444 | private X_inv47() { | ||
445 | super(GeneratedPQuery.INSTANCE); | ||
446 | } | ||
447 | |||
448 | /** | ||
449 | * @return the singleton instance of the query specification | ||
450 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
451 | * | ||
452 | */ | ||
453 | public static X_inv47 instance() { | ||
454 | try{ | ||
455 | return LazyHolder.INSTANCE; | ||
456 | } catch (ExceptionInInitializerError err) { | ||
457 | throw processInitializerError(err); | ||
458 | } | ||
459 | } | ||
460 | |||
461 | @Override | ||
462 | protected X_inv47.Matcher instantiate(final ViatraQueryEngine engine) { | ||
463 | return X_inv47.Matcher.on(engine); | ||
464 | } | ||
465 | |||
466 | @Override | ||
467 | public X_inv47.Matcher instantiate() { | ||
468 | return X_inv47.Matcher.create(); | ||
469 | } | ||
470 | |||
471 | @Override | ||
472 | public X_inv47.Match newEmptyMatch() { | ||
473 | return X_inv47.Match.newEmptyMatch(); | ||
474 | } | ||
475 | |||
476 | @Override | ||
477 | public X_inv47.Match newMatch(final Object... parameters) { | ||
478 | return X_inv47.Match.newMatch((Taxation.Legal_Union_Record) parameters[0]); | ||
479 | } | ||
480 | |||
481 | /** | ||
482 | * Inner class allowing the singleton instance of {@link X_inv47} to be created | ||
483 | * <b>not</b> at the class load time of the outer class, | ||
484 | * but rather at the first call to {@link X_inv47#instance()}. | ||
485 | * | ||
486 | * <p> This workaround is required e.g. to support recursion. | ||
487 | * | ||
488 | */ | ||
489 | private static class LazyHolder { | ||
490 | private static final X_inv47 INSTANCE = new X_inv47(); | ||
491 | |||
492 | /** | ||
493 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
494 | * This initialization order is required to support indirect recursion. | ||
495 | * | ||
496 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
497 | * | ||
498 | */ | ||
499 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
500 | |||
501 | public static Object ensureInitialized() { | ||
502 | INSTANCE.ensureInitializedInternal(); | ||
503 | return null; | ||
504 | } | ||
505 | } | ||
506 | |||
507 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
508 | private static final X_inv47.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
509 | |||
510 | private final PParameter parameter_lur = new PParameter("lur", "Taxation.Legal_Union_Record", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http:///TaxCard.ecore", "Legal_Union_Record")), PParameterDirection.INOUT); | ||
511 | |||
512 | private final List<PParameter> parameters = Arrays.asList(parameter_lur); | ||
513 | |||
514 | private GeneratedPQuery() { | ||
515 | super(PVisibility.PUBLIC); | ||
516 | } | ||
517 | |||
518 | @Override | ||
519 | public String getFullyQualifiedName() { | ||
520 | return "queries.x_inv47"; | ||
521 | } | ||
522 | |||
523 | @Override | ||
524 | public List<String> getParameterNames() { | ||
525 | return Arrays.asList("lur"); | ||
526 | } | ||
527 | |||
528 | @Override | ||
529 | public List<PParameter> getParameters() { | ||
530 | return parameters; | ||
531 | } | ||
532 | |||
533 | @Override | ||
534 | public Set<PBody> doGetContainedBodies() { | ||
535 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
536 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
537 | { | ||
538 | PBody body = new PBody(this); | ||
539 | PVariable var_lur = body.getOrCreateVariableByName("lur"); | ||
540 | new TypeConstraint(body, Tuples.flatTupleOf(var_lur), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Legal_Union_Record"))); | ||
541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
542 | new ExportedParameter(body, var_lur, parameter_lur) | ||
543 | )); | ||
544 | // Legal_Union_Record.separation_cause(lur, ::NONE) | ||
545 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
546 | new ConstantValue(body, var__virtual_0_, getEnumLiteral("http:///TaxCard.ecore", "Separation_Causes", "NONE").getInstance()); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var_lur), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Legal_Union_Record"))); | ||
548 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
549 | new TypeConstraint(body, Tuples.flatTupleOf(var_lur, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Legal_Union_Record", "separation_cause"))); | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http:///TaxCard.ecore", "Separation_Causes"))); | ||
551 | new Equality(body, var__virtual_1_, var__virtual_0_); | ||
552 | // Legal_Union_Record.end_year(lur, -1) | ||
553 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
554 | new ConstantValue(body, var__virtual_2_, -1); | ||
555 | new TypeConstraint(body, Tuples.flatTupleOf(var_lur), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Legal_Union_Record"))); | ||
556 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
557 | new TypeConstraint(body, Tuples.flatTupleOf(var_lur, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Legal_Union_Record", "end_year"))); | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
559 | new Equality(body, var__virtual_3_, var__virtual_2_); | ||
560 | bodies.add(body); | ||
561 | } | ||
562 | return bodies; | ||
563 | } | ||
564 | } | ||
565 | |||
566 | private static int evaluateExpression_1_1() { | ||
567 | return 1; | ||
568 | } | ||
569 | } | ||