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