diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-27 10:45:28 -0400 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-27 10:45:28 -0400 |
commit | 36ca60e5b6bd047a4f444d96241bd60a01bbab17 (patch) | |
tree | 472ee15861945af6b7056d19250734ffab4c3aef /Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.gz VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.tar.zst VIATRA-Generator-36ca60e5b6bd047a4f444d96241bd60a01bbab17.zip |
rename Pledge Case Studies and add familyTree case study
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java | 163 |
1 files changed, 160 insertions, 3 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java index d9fed653..81665825 100644 --- a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv07.java | |||
@@ -1,14 +1,14 @@ | |||
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 | ||
6 | import Taxation.Income; | 6 | import Taxation.Income; |
7 | import com.google.common.base.Objects; | ||
8 | import java.util.Arrays; | 7 | import java.util.Arrays; |
9 | import java.util.Collection; | 8 | import java.util.Collection; |
10 | import java.util.LinkedHashSet; | 9 | import java.util.LinkedHashSet; |
11 | import java.util.List; | 10 | import java.util.List; |
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; | 14 | import java.util.function.Consumer; |
@@ -17,6 +17,7 @@ import java.util.stream.Stream; | |||
17 | import org.apache.log4j.Logger; | 17 | import org.apache.log4j.Logger; |
18 | import org.eclipse.emf.ecore.EClass; | 18 | import org.eclipse.emf.ecore.EClass; |
19 | import org.eclipse.emf.ecore.EDataType; | 19 | import org.eclipse.emf.ecore.EDataType; |
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | 21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; |
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | 22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; |
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | 23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; |
@@ -77,6 +78,162 @@ public final class Inv07 extends BaseGeneratedEMFQuerySpecification<Inv07.Matche | |||
77 | * | 78 | * |
78 | */ | 79 | */ |
79 | public static abstract class Match extends BasePatternMatch { | 80 | public static abstract class Match extends BasePatternMatch { |
81 | private Income fInc; | ||
82 | |||
83 | private static List<String> parameterNames = makeImmutableList("inc"); | ||
84 | |||
85 | private Match(final Income pInc) { | ||
86 | this.fInc = pInc; | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final String parameterName) { | ||
91 | switch(parameterName) { | ||
92 | case "inc": return this.fInc; | ||
93 | default: return null; | ||
94 | } | ||
95 | } | ||
96 | |||
97 | @Override | ||
98 | public Object get(final int index) { | ||
99 | switch(index) { | ||
100 | case 0: return this.fInc; | ||
101 | default: return null; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | public Income getInc() { | ||
106 | return this.fInc; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public boolean set(final String parameterName, final Object newValue) { | ||
111 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
112 | if ("inc".equals(parameterName) ) { | ||
113 | this.fInc = (Income) newValue; | ||
114 | return true; | ||
115 | } | ||
116 | return false; | ||
117 | } | ||
118 | |||
119 | public void setInc(final Income pInc) { | ||
120 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
121 | this.fInc = pInc; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public String patternName() { | ||
126 | return "queries.inv07"; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public List<String> parameterNames() { | ||
131 | return Inv07.Match.parameterNames; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public Object[] toArray() { | ||
136 | return new Object[]{fInc}; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public Inv07.Match toImmutable() { | ||
141 | return isMutable() ? newMatch(fInc) : this; | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public String prettyPrint() { | ||
146 | StringBuilder result = new StringBuilder(); | ||
147 | result.append("\"inc\"=" + prettyPrintValue(fInc)); | ||
148 | return result.toString(); | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public int hashCode() { | ||
153 | return Objects.hash(fInc); | ||
154 | } | ||
155 | |||
156 | @Override | ||
157 | public boolean equals(final Object obj) { | ||
158 | if (this == obj) | ||
159 | return true; | ||
160 | if (obj == null) { | ||
161 | return false; | ||
162 | } | ||
163 | if ((obj instanceof Inv07.Match)) { | ||
164 | Inv07.Match other = (Inv07.Match) obj; | ||
165 | return Objects.equals(fInc, other.fInc); | ||
166 | } else { | ||
167 | // this should be infrequent | ||
168 | if (!(obj instanceof IPatternMatch)) { | ||
169 | return false; | ||
170 | } | ||
171 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
172 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | @Override | ||
177 | public Inv07 specification() { | ||
178 | return Inv07.instance(); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * Returns an empty, mutable match. | ||
183 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
184 | * | ||
185 | * @return the empty match. | ||
186 | * | ||
187 | */ | ||
188 | public static Inv07.Match newEmptyMatch() { | ||
189 | return new Mutable(null); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns a mutable (partial) match. | ||
194 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
195 | * | ||
196 | * @param pInc the fixed value of pattern parameter inc, or null if not bound. | ||
197 | * @return the new, mutable (partial) match object. | ||
198 | * | ||
199 | */ | ||
200 | public static Inv07.Match newMutableMatch(final Income pInc) { | ||
201 | return new Mutable(pInc); | ||
202 | } | ||
203 | |||
204 | /** | ||
205 | * Returns a new (partial) match. | ||
206 | * This can be used e.g. to call the matcher with a partial match. | ||
207 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
208 | * @param pInc the fixed value of pattern parameter inc, or null if not bound. | ||
209 | * @return the (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static Inv07.Match newMatch(final Income pInc) { | ||
213 | return new Immutable(pInc); | ||
214 | } | ||
215 | |||
216 | private static final class Mutable extends Inv07.Match { | ||
217 | Mutable(final Income pInc) { | ||
218 | super(pInc); | ||
219 | } | ||
220 | |||
221 | @Override | ||
222 | public boolean isMutable() { | ||
223 | return true; | ||
224 | } | ||
225 | } | ||
226 | |||
227 | private static final class Immutable extends Inv07.Match { | ||
228 | Immutable(final Income pInc) { | ||
229 | super(pInc); | ||
230 | } | ||
231 | |||
232 | @Override | ||
233 | public boolean isMutable() { | ||
234 | return false; | ||
235 | } | ||
236 | } | ||
80 | } | 237 | } |
81 | 238 | ||
82 | /** | 239 | /** |
@@ -449,7 +606,7 @@ public final class Inv07 extends BaseGeneratedEMFQuerySpecification<Inv07.Matche | |||
449 | } | 606 | } |
450 | 607 | ||
451 | private static boolean evaluateExpression_1_1(final Double d1, final Double d2) { | 608 | private static boolean evaluateExpression_1_1(final Double d1, final Double d2) { |
452 | boolean _notEquals = (!Objects.equal(d1, d2)); | 609 | boolean _notEquals = (!com.google.common.base.Objects.equal(d1, d2)); |
453 | return _notEquals; | 610 | return _notEquals; |
454 | } | 611 | } |
455 | } | 612 | } |