diff options
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java | 80 |
1 files changed, 77 insertions, 3 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java index 35b30b0f..995946eb 100644 --- a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv11_incNotOver100.java | |||
@@ -1,5 +1,5 @@ | |||
1 | /** | 1 | /** |
2 | * Generated from platform:/resource/case.study.a.queries/src/queries/case_study_A.vql | 2 | * Generated from platform:/resource/case.study.pledge.run/src/queries/case_study_A.vql |
3 | */ | 3 | */ |
4 | package queries; | 4 | package queries; |
5 | 5 | ||
@@ -11,11 +11,14 @@ import java.util.List; | |||
11 | import java.util.Objects; | 11 | import java.util.Objects; |
12 | import java.util.Optional; | 12 | import java.util.Optional; |
13 | import java.util.Set; | 13 | import java.util.Set; |
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
14 | import java.util.stream.Stream; | 16 | import java.util.stream.Stream; |
15 | import org.apache.log4j.Logger; | 17 | import org.apache.log4j.Logger; |
16 | import org.eclipse.emf.ecore.EClass; | 18 | import org.eclipse.emf.ecore.EClass; |
17 | import org.eclipse.emf.ecore.EDataType; | 19 | import org.eclipse.emf.ecore.EDataType; |
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | 20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; |
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
19 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | 22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; |
20 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | 23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; |
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | 24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; |
@@ -36,6 +39,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeCo | |||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | 39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; |
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | 40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; |
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | 41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; |
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | 43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; |
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | 44 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; |
41 | 45 | ||
@@ -312,7 +316,9 @@ public final class X_inv11_incNotOver100 extends BaseGeneratedEMFQuerySpecificat | |||
312 | * @return matches represented as a Match object. | 316 | * @return matches represented as a Match object. |
313 | * | 317 | * |
314 | */ | 318 | */ |
315 | public Collection<X_inv11_incNotOver100.Match> getAllMatches(); | 319 | public Collection<X_inv11_incNotOver100.Match> getAllMatches(final Expense pExp) { |
320 | return rawStreamAllMatches(new Object[]{pExp}).collect(Collectors.toSet()); | ||
321 | } | ||
316 | 322 | ||
317 | /** | 323 | /** |
318 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | 324 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. |
@@ -368,7 +374,9 @@ public final class X_inv11_incNotOver100 extends BaseGeneratedEMFQuerySpecificat | |||
368 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | 374 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked |
369 | * | 375 | * |
370 | */ | 376 | */ |
371 | public boolean forOneArbitraryMatch(); | 377 | public boolean forOneArbitraryMatch(final Expense pExp, final Consumer<? super X_inv11_incNotOver100.Match> processor) { |
378 | return rawForOneArbitraryMatch(new Object[]{pExp}, processor); | ||
379 | } | ||
372 | 380 | ||
373 | /** | 381 | /** |
374 | * Returns a new (partial) match. | 382 | * Returns a new (partial) match. |
@@ -381,6 +389,72 @@ public final class X_inv11_incNotOver100 extends BaseGeneratedEMFQuerySpecificat | |||
381 | public X_inv11_incNotOver100.Match newMatch(final Expense pExp) { | 389 | public X_inv11_incNotOver100.Match newMatch(final Expense pExp) { |
382 | return X_inv11_incNotOver100.Match.newMatch(pExp); | 390 | return X_inv11_incNotOver100.Match.newMatch(pExp); |
383 | } | 391 | } |
392 | |||
393 | /** | ||
394 | * Retrieve the set of values that occur in matches for exp. | ||
395 | * @return the Set of all values or empty set if there are no matches | ||
396 | * | ||
397 | */ | ||
398 | protected Stream<Expense> rawStreamAllValuesOfexp(final Object[] parameters) { | ||
399 | return rawStreamAllValues(POSITION_EXP, parameters).map(Expense.class::cast); | ||
400 | } | ||
401 | |||
402 | /** | ||
403 | * Retrieve the set of values that occur in matches for exp. | ||
404 | * @return the Set of all values or empty set if there are no matches | ||
405 | * | ||
406 | */ | ||
407 | public Set<Expense> getAllValuesOfexp() { | ||
408 | return rawStreamAllValuesOfexp(emptyArray()).collect(Collectors.toSet()); | ||
409 | } | ||
410 | |||
411 | /** | ||
412 | * Retrieve the set of values that occur in matches for exp. | ||
413 | * @return the Set of all values or empty set if there are no matches | ||
414 | * | ||
415 | */ | ||
416 | public Stream<Expense> streamAllValuesOfexp() { | ||
417 | return rawStreamAllValuesOfexp(emptyArray()); | ||
418 | } | ||
419 | |||
420 | @Override | ||
421 | protected X_inv11_incNotOver100.Match tupleToMatch(final Tuple t) { | ||
422 | try { | ||
423 | return X_inv11_incNotOver100.Match.newMatch((Expense) t.get(POSITION_EXP)); | ||
424 | } catch(ClassCastException e) { | ||
425 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
426 | return null; | ||
427 | } | ||
428 | } | ||
429 | |||
430 | @Override | ||
431 | protected X_inv11_incNotOver100.Match arrayToMatch(final Object[] match) { | ||
432 | try { | ||
433 | return X_inv11_incNotOver100.Match.newMatch((Expense) match[POSITION_EXP]); | ||
434 | } catch(ClassCastException e) { | ||
435 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
436 | return null; | ||
437 | } | ||
438 | } | ||
439 | |||
440 | @Override | ||
441 | protected X_inv11_incNotOver100.Match arrayToMatchMutable(final Object[] match) { | ||
442 | try { | ||
443 | return X_inv11_incNotOver100.Match.newMutableMatch((Expense) match[POSITION_EXP]); | ||
444 | } catch(ClassCastException e) { | ||
445 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
446 | return null; | ||
447 | } | ||
448 | } | ||
449 | |||
450 | /** | ||
451 | * @return the singleton instance of the query specification of this pattern | ||
452 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
453 | * | ||
454 | */ | ||
455 | public static IQuerySpecification<X_inv11_incNotOver100.Matcher> querySpecification() { | ||
456 | return X_inv11_incNotOver100.instance(); | ||
457 | } | ||
384 | } | 458 | } |
385 | 459 | ||
386 | private X_inv11_incNotOver100() { | 460 | private X_inv11_incNotOver100() { |