aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java')
-rw-r--r--Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java702
1 files changed, 0 insertions, 702 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java
deleted file mode 100644
index 147b27f9..00000000
--- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/src-gen/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/EntryInRegion.java
+++ /dev/null
@@ -1,702 +0,0 @@
1/**
2 * Generated from platform:/resource/ca.mcgill.ecse.dslreasoner.standalone.test/queries/ca/mcgill/ecse/dslreasoner/standalone/test/yakindu/queries/yakinduPatterns.vql
3 */
4package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries;
5
6import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Entry;
7import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Region;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
40import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
41
42/**
43 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
44 *
45 * <p>Original source:
46 * <code><pre>
47 * /////////
48 * // Entry
49 * /////////
50 *
51 * pattern entryInRegion(r1 : Region, e1 : Entry) {
52 * Region.vertices(r1, e1);
53 * }
54 * </pre></code>
55 *
56 * @see Matcher
57 * @see Match
58 *
59 */
60@SuppressWarnings("all")
61public final class EntryInRegion extends BaseGeneratedEMFQuerySpecification<EntryInRegion.Matcher> {
62 /**
63 * Pattern-specific match representation of the ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion pattern,
64 * to be used in conjunction with {@link Matcher}.
65 *
66 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
67 * Each instance is a (possibly partial) substitution of pattern parameters,
68 * usable to represent a match of the pattern in the result of a query,
69 * or to specify the bound (fixed) input parameters when issuing a query.
70 *
71 * @see Matcher
72 *
73 */
74 public static abstract class Match extends BasePatternMatch {
75 private Region fR1;
76
77 private Entry fE1;
78
79 private static List<String> parameterNames = makeImmutableList("r1", "e1");
80
81 private Match(final Region pR1, final Entry pE1) {
82 this.fR1 = pR1;
83 this.fE1 = pE1;
84 }
85
86 @Override
87 public Object get(final String parameterName) {
88 if ("r1".equals(parameterName)) return this.fR1;
89 if ("e1".equals(parameterName)) return this.fE1;
90 return null;
91 }
92
93 public Region getR1() {
94 return this.fR1;
95 }
96
97 public Entry getE1() {
98 return this.fE1;
99 }
100
101 @Override
102 public boolean set(final String parameterName, final Object newValue) {
103 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
104 if ("r1".equals(parameterName) ) {
105 this.fR1 = (Region) newValue;
106 return true;
107 }
108 if ("e1".equals(parameterName) ) {
109 this.fE1 = (Entry) newValue;
110 return true;
111 }
112 return false;
113 }
114
115 public void setR1(final Region pR1) {
116 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
117 this.fR1 = pR1;
118 }
119
120 public void setE1(final Entry pE1) {
121 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
122 this.fE1 = pE1;
123 }
124
125 @Override
126 public String patternName() {
127 return "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion";
128 }
129
130 @Override
131 public List<String> parameterNames() {
132 return EntryInRegion.Match.parameterNames;
133 }
134
135 @Override
136 public Object[] toArray() {
137 return new Object[]{fR1, fE1};
138 }
139
140 @Override
141 public EntryInRegion.Match toImmutable() {
142 return isMutable() ? newMatch(fR1, fE1) : this;
143 }
144
145 @Override
146 public String prettyPrint() {
147 StringBuilder result = new StringBuilder();
148 result.append("\"r1\"=" + prettyPrintValue(fR1) + ", ");
149 result.append("\"e1\"=" + prettyPrintValue(fE1));
150 return result.toString();
151 }
152
153 @Override
154 public int hashCode() {
155 return Objects.hash(fR1, fE1);
156 }
157
158 @Override
159 public boolean equals(final Object obj) {
160 if (this == obj)
161 return true;
162 if (obj == null) {
163 return false;
164 }
165 if ((obj instanceof EntryInRegion.Match)) {
166 EntryInRegion.Match other = (EntryInRegion.Match) obj;
167 return Objects.equals(fR1, other.fR1) && Objects.equals(fE1, other.fE1);
168 } else {
169 // this should be infrequent
170 if (!(obj instanceof IPatternMatch)) {
171 return false;
172 }
173 IPatternMatch otherSig = (IPatternMatch) obj;
174 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
175 }
176 }
177
178 @Override
179 public EntryInRegion specification() {
180 return EntryInRegion.instance();
181 }
182
183 /**
184 * Returns an empty, mutable match.
185 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
186 *
187 * @return the empty match.
188 *
189 */
190 public static EntryInRegion.Match newEmptyMatch() {
191 return new Mutable(null, null);
192 }
193
194 /**
195 * Returns a mutable (partial) match.
196 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
197 *
198 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
199 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
200 * @return the new, mutable (partial) match object.
201 *
202 */
203 public static EntryInRegion.Match newMutableMatch(final Region pR1, final Entry pE1) {
204 return new Mutable(pR1, pE1);
205 }
206
207 /**
208 * Returns a new (partial) match.
209 * This can be used e.g. to call the matcher with a partial match.
210 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
211 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
212 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
213 * @return the (partial) match object.
214 *
215 */
216 public static EntryInRegion.Match newMatch(final Region pR1, final Entry pE1) {
217 return new Immutable(pR1, pE1);
218 }
219
220 private static final class Mutable extends EntryInRegion.Match {
221 Mutable(final Region pR1, final Entry pE1) {
222 super(pR1, pE1);
223 }
224
225 @Override
226 public boolean isMutable() {
227 return true;
228 }
229 }
230
231 private static final class Immutable extends EntryInRegion.Match {
232 Immutable(final Region pR1, final Entry pE1) {
233 super(pR1, pE1);
234 }
235
236 @Override
237 public boolean isMutable() {
238 return false;
239 }
240 }
241 }
242
243 /**
244 * Generated pattern matcher API of the ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion pattern,
245 * providing pattern-specific query methods.
246 *
247 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
248 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
249 *
250 * <p>Matches of the pattern will be represented as {@link Match}.
251 *
252 * <p>Original source:
253 * <code><pre>
254 * /////////
255 * // Entry
256 * /////////
257 *
258 * pattern entryInRegion(r1 : Region, e1 : Entry) {
259 * Region.vertices(r1, e1);
260 * }
261 * </pre></code>
262 *
263 * @see Match
264 * @see EntryInRegion
265 *
266 */
267 public static class Matcher extends BaseMatcher<EntryInRegion.Match> {
268 /**
269 * Initializes the pattern matcher within an existing VIATRA Query engine.
270 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
271 *
272 * @param engine the existing VIATRA Query engine in which this matcher will be created.
273 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
274 *
275 */
276 public static EntryInRegion.Matcher on(final ViatraQueryEngine engine) {
277 // check if matcher already exists
278 Matcher matcher = engine.getExistingMatcher(querySpecification());
279 if (matcher == null) {
280 matcher = (Matcher)engine.getMatcher(querySpecification());
281 }
282 return matcher;
283 }
284
285 /**
286 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
287 * @return an initialized matcher
288 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
289 *
290 */
291 public static EntryInRegion.Matcher create() {
292 return new Matcher();
293 }
294
295 private final static int POSITION_R1 = 0;
296
297 private final static int POSITION_E1 = 1;
298
299 private final static Logger LOGGER = ViatraQueryLoggingUtil.getLogger(EntryInRegion.Matcher.class);
300
301 /**
302 * Initializes the pattern matcher within an existing VIATRA Query engine.
303 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
304 *
305 * @param engine the existing VIATRA Query engine in which this matcher will be created.
306 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
307 *
308 */
309 private Matcher() {
310 super(querySpecification());
311 }
312
313 /**
314 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
315 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
316 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
317 * @return matches represented as a Match object.
318 *
319 */
320 public Collection<EntryInRegion.Match> getAllMatches(final Region pR1, final Entry pE1) {
321 return rawStreamAllMatches(new Object[]{pR1, pE1}).collect(Collectors.toSet());
322 }
323
324 /**
325 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
326 * </p>
327 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
328 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
329 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
330 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
331 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
332 * @return a stream of matches represented as a Match object.
333 *
334 */
335 public Stream<EntryInRegion.Match> streamAllMatches(final Region pR1, final Entry pE1) {
336 return rawStreamAllMatches(new Object[]{pR1, pE1});
337 }
338
339 /**
340 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
341 * Neither determinism nor randomness of selection is guaranteed.
342 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
343 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
344 * @return a match represented as a Match object, or null if no match is found.
345 *
346 */
347 public Optional<EntryInRegion.Match> getOneArbitraryMatch(final Region pR1, final Entry pE1) {
348 return rawGetOneArbitraryMatch(new Object[]{pR1, pE1});
349 }
350
351 /**
352 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
353 * under any possible substitution of the unspecified parameters (if any).
354 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
355 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
356 * @return true if the input is a valid (partial) match of the pattern.
357 *
358 */
359 public boolean hasMatch(final Region pR1, final Entry pE1) {
360 return rawHasMatch(new Object[]{pR1, pE1});
361 }
362
363 /**
364 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
365 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
366 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
367 * @return the number of pattern matches found.
368 *
369 */
370 public int countMatches(final Region pR1, final Entry pE1) {
371 return rawCountMatches(new Object[]{pR1, pE1});
372 }
373
374 /**
375 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
376 * Neither determinism nor randomness of selection is guaranteed.
377 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
378 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
379 * @param processor the action that will process the selected match.
380 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
381 *
382 */
383 public boolean forOneArbitraryMatch(final Region pR1, final Entry pE1, final Consumer<? super EntryInRegion.Match> processor) {
384 return rawForOneArbitraryMatch(new Object[]{pR1, pE1}, processor);
385 }
386
387 /**
388 * Returns a new (partial) match.
389 * This can be used e.g. to call the matcher with a partial match.
390 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
391 * @param pR1 the fixed value of pattern parameter r1, or null if not bound.
392 * @param pE1 the fixed value of pattern parameter e1, or null if not bound.
393 * @return the (partial) match object.
394 *
395 */
396 public EntryInRegion.Match newMatch(final Region pR1, final Entry pE1) {
397 return EntryInRegion.Match.newMatch(pR1, pE1);
398 }
399
400 /**
401 * Retrieve the set of values that occur in matches for r1.
402 * @return the Set of all values or empty set if there are no matches
403 *
404 */
405 protected Stream<Region> rawStreamAllValuesOfr1(final Object[] parameters) {
406 return rawStreamAllValues(POSITION_R1, parameters).map(Region.class::cast);
407 }
408
409 /**
410 * Retrieve the set of values that occur in matches for r1.
411 * @return the Set of all values or empty set if there are no matches
412 *
413 */
414 public Set<Region> getAllValuesOfr1() {
415 return rawStreamAllValuesOfr1(emptyArray()).collect(Collectors.toSet());
416 }
417
418 /**
419 * Retrieve the set of values that occur in matches for r1.
420 * @return the Set of all values or empty set if there are no matches
421 *
422 */
423 public Stream<Region> streamAllValuesOfr1() {
424 return rawStreamAllValuesOfr1(emptyArray());
425 }
426
427 /**
428 * Retrieve the set of values that occur in matches for r1.
429 * </p>
430 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
431 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
432 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
433 *
434 * @return the Stream of all values or empty set if there are no matches
435 *
436 */
437 public Stream<Region> streamAllValuesOfr1(final EntryInRegion.Match partialMatch) {
438 return rawStreamAllValuesOfr1(partialMatch.toArray());
439 }
440
441 /**
442 * Retrieve the set of values that occur in matches for r1.
443 * </p>
444 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
445 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
446 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
447 *
448 * @return the Stream of all values or empty set if there are no matches
449 *
450 */
451 public Stream<Region> streamAllValuesOfr1(final Entry pE1) {
452 return rawStreamAllValuesOfr1(new Object[]{null, pE1});
453 }
454
455 /**
456 * Retrieve the set of values that occur in matches for r1.
457 * @return the Set of all values or empty set if there are no matches
458 *
459 */
460 public Set<Region> getAllValuesOfr1(final EntryInRegion.Match partialMatch) {
461 return rawStreamAllValuesOfr1(partialMatch.toArray()).collect(Collectors.toSet());
462 }
463
464 /**
465 * Retrieve the set of values that occur in matches for r1.
466 * @return the Set of all values or empty set if there are no matches
467 *
468 */
469 public Set<Region> getAllValuesOfr1(final Entry pE1) {
470 return rawStreamAllValuesOfr1(new Object[]{null, pE1}).collect(Collectors.toSet());
471 }
472
473 /**
474 * Retrieve the set of values that occur in matches for e1.
475 * @return the Set of all values or empty set if there are no matches
476 *
477 */
478 protected Stream<Entry> rawStreamAllValuesOfe1(final Object[] parameters) {
479 return rawStreamAllValues(POSITION_E1, parameters).map(Entry.class::cast);
480 }
481
482 /**
483 * Retrieve the set of values that occur in matches for e1.
484 * @return the Set of all values or empty set if there are no matches
485 *
486 */
487 public Set<Entry> getAllValuesOfe1() {
488 return rawStreamAllValuesOfe1(emptyArray()).collect(Collectors.toSet());
489 }
490
491 /**
492 * Retrieve the set of values that occur in matches for e1.
493 * @return the Set of all values or empty set if there are no matches
494 *
495 */
496 public Stream<Entry> streamAllValuesOfe1() {
497 return rawStreamAllValuesOfe1(emptyArray());
498 }
499
500 /**
501 * Retrieve the set of values that occur in matches for e1.
502 * </p>
503 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
504 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
505 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
506 *
507 * @return the Stream of all values or empty set if there are no matches
508 *
509 */
510 public Stream<Entry> streamAllValuesOfe1(final EntryInRegion.Match partialMatch) {
511 return rawStreamAllValuesOfe1(partialMatch.toArray());
512 }
513
514 /**
515 * Retrieve the set of values that occur in matches for e1.
516 * </p>
517 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
518 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
519 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
520 *
521 * @return the Stream of all values or empty set if there are no matches
522 *
523 */
524 public Stream<Entry> streamAllValuesOfe1(final Region pR1) {
525 return rawStreamAllValuesOfe1(new Object[]{pR1, null});
526 }
527
528 /**
529 * Retrieve the set of values that occur in matches for e1.
530 * @return the Set of all values or empty set if there are no matches
531 *
532 */
533 public Set<Entry> getAllValuesOfe1(final EntryInRegion.Match partialMatch) {
534 return rawStreamAllValuesOfe1(partialMatch.toArray()).collect(Collectors.toSet());
535 }
536
537 /**
538 * Retrieve the set of values that occur in matches for e1.
539 * @return the Set of all values or empty set if there are no matches
540 *
541 */
542 public Set<Entry> getAllValuesOfe1(final Region pR1) {
543 return rawStreamAllValuesOfe1(new Object[]{pR1, null}).collect(Collectors.toSet());
544 }
545
546 @Override
547 protected EntryInRegion.Match tupleToMatch(final Tuple t) {
548 try {
549 return EntryInRegion.Match.newMatch((Region) t.get(POSITION_R1), (Entry) t.get(POSITION_E1));
550 } catch(ClassCastException e) {
551 LOGGER.error("Element(s) in tuple not properly typed!",e);
552 return null;
553 }
554 }
555
556 @Override
557 protected EntryInRegion.Match arrayToMatch(final Object[] match) {
558 try {
559 return EntryInRegion.Match.newMatch((Region) match[POSITION_R1], (Entry) match[POSITION_E1]);
560 } catch(ClassCastException e) {
561 LOGGER.error("Element(s) in array not properly typed!",e);
562 return null;
563 }
564 }
565
566 @Override
567 protected EntryInRegion.Match arrayToMatchMutable(final Object[] match) {
568 try {
569 return EntryInRegion.Match.newMutableMatch((Region) match[POSITION_R1], (Entry) match[POSITION_E1]);
570 } catch(ClassCastException e) {
571 LOGGER.error("Element(s) in array not properly typed!",e);
572 return null;
573 }
574 }
575
576 /**
577 * @return the singleton instance of the query specification of this pattern
578 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
579 *
580 */
581 public static IQuerySpecification<EntryInRegion.Matcher> querySpecification() {
582 return EntryInRegion.instance();
583 }
584 }
585
586 private EntryInRegion() {
587 super(GeneratedPQuery.INSTANCE);
588 }
589
590 /**
591 * @return the singleton instance of the query specification
592 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
593 *
594 */
595 public static EntryInRegion instance() {
596 try{
597 return LazyHolder.INSTANCE;
598 } catch (ExceptionInInitializerError err) {
599 throw processInitializerError(err);
600 }
601 }
602
603 @Override
604 protected EntryInRegion.Matcher instantiate(final ViatraQueryEngine engine) {
605 return EntryInRegion.Matcher.on(engine);
606 }
607
608 @Override
609 public EntryInRegion.Matcher instantiate() {
610 return EntryInRegion.Matcher.create();
611 }
612
613 @Override
614 public EntryInRegion.Match newEmptyMatch() {
615 return EntryInRegion.Match.newEmptyMatch();
616 }
617
618 @Override
619 public EntryInRegion.Match newMatch(final Object... parameters) {
620 return EntryInRegion.Match.newMatch((ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Region) parameters[0], (ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Entry) parameters[1]);
621 }
622
623 /**
624 * Inner class allowing the singleton instance of {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.EntryInRegion (visibility: PUBLIC, simpleName: EntryInRegion, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.EntryInRegion, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
625 * <b>not</b> at the class load time of the outer class,
626 * but rather at the first call to {@link JvmGenericType: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.EntryInRegion (visibility: PUBLIC, simpleName: EntryInRegion, identifier: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.EntryInRegion, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
627 *
628 * <p> This workaround is required e.g. to support recursion.
629 *
630 */
631 private static class LazyHolder {
632 private final static EntryInRegion INSTANCE = new EntryInRegion();
633
634 /**
635 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
636 * This initialization order is required to support indirect recursion.
637 *
638 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
639 *
640 */
641 private final static Object STATIC_INITIALIZER = ensureInitialized();
642
643 public static Object ensureInitialized() {
644 INSTANCE.ensureInitializedInternal();
645 return null;
646 }
647 }
648
649 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
650 private final static EntryInRegion.GeneratedPQuery INSTANCE = new GeneratedPQuery();
651
652 private final PParameter parameter_r1 = new PParameter("r1", "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Region", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("YakinduMetamodel", "Region")), PParameterDirection.INOUT);
653
654 private final PParameter parameter_e1 = new PParameter("e1", "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Entry", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("YakinduMetamodel", "Entry")), PParameterDirection.INOUT);
655
656 private final List<PParameter> parameters = Arrays.asList(parameter_r1, parameter_e1);
657
658 private GeneratedPQuery() {
659 super(PVisibility.PUBLIC);
660 }
661
662 @Override
663 public String getFullyQualifiedName() {
664 return "ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.queries.entryInRegion";
665 }
666
667 @Override
668 public List<String> getParameterNames() {
669 return Arrays.asList("r1","e1");
670 }
671
672 @Override
673 public List<PParameter> getParameters() {
674 return parameters;
675 }
676
677 @Override
678 public Set<PBody> doGetContainedBodies() {
679 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
680 Set<PBody> bodies = new LinkedHashSet<>();
681 {
682 PBody body = new PBody(this);
683 PVariable var_r1 = body.getOrCreateVariableByName("r1");
684 PVariable var_e1 = body.getOrCreateVariableByName("e1");
685 new TypeConstraint(body, Tuples.flatTupleOf(var_r1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("YakinduMetamodel", "Region")));
686 new TypeConstraint(body, Tuples.flatTupleOf(var_e1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("YakinduMetamodel", "Entry")));
687 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
688 new ExportedParameter(body, var_r1, parameter_r1),
689 new ExportedParameter(body, var_e1, parameter_e1)
690 ));
691 // Region.vertices(r1, e1)
692 new TypeConstraint(body, Tuples.flatTupleOf(var_r1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("YakinduMetamodel", "Region")));
693 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
694 new TypeConstraint(body, Tuples.flatTupleOf(var_r1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("YakinduMetamodel", "Region", "vertices")));
695 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("YakinduMetamodel", "Vertex")));
696 new Equality(body, var__virtual_0_, var_e1);
697 bodies.add(body);
698 }
699 return bodies;
700 }
701 }
702}