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