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