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