aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java')
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java164
1 files changed, 162 insertions, 2 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java
index fcf7ac89..aafdbe41 100644
--- a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.java
+++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/Inv06.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 */
4package queries; 4package queries;
5 5
@@ -8,6 +8,7 @@ import java.util.Arrays;
8import java.util.Collection; 8import java.util.Collection;
9import java.util.LinkedHashSet; 9import java.util.LinkedHashSet;
10import java.util.List; 10import java.util.List;
11import java.util.Objects;
11import java.util.Optional; 12import java.util.Optional;
12import java.util.Set; 13import java.util.Set;
13import java.util.function.Consumer; 14import java.util.function.Consumer;
@@ -16,6 +17,7 @@ import java.util.stream.Stream;
16import org.apache.log4j.Logger; 17import org.apache.log4j.Logger;
17import org.eclipse.emf.ecore.EClass; 18import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.EDataType; 19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification; 21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; 22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; 23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
@@ -82,6 +84,162 @@ public final class Inv06 extends BaseGeneratedEMFQuerySpecification<Inv06.Matche
82 * 84 *
83 */ 85 */
84 public static abstract class Match extends BasePatternMatch { 86 public static abstract class Match extends BasePatternMatch {
87 private Tax_Payer fTp;
88
89 private static List<String> parameterNames = makeImmutableList("tp");
90
91 private Match(final Tax_Payer pTp) {
92 this.fTp = pTp;
93 }
94
95 @Override
96 public Object get(final String parameterName) {
97 switch(parameterName) {
98 case "tp": return this.fTp;
99 default: return null;
100 }
101 }
102
103 @Override
104 public Object get(final int index) {
105 switch(index) {
106 case 0: return this.fTp;
107 default: return null;
108 }
109 }
110
111 public Tax_Payer getTp() {
112 return this.fTp;
113 }
114
115 @Override
116 public boolean set(final String parameterName, final Object newValue) {
117 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
118 if ("tp".equals(parameterName) ) {
119 this.fTp = (Tax_Payer) newValue;
120 return true;
121 }
122 return false;
123 }
124
125 public void setTp(final Tax_Payer pTp) {
126 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
127 this.fTp = pTp;
128 }
129
130 @Override
131 public String patternName() {
132 return "queries.inv06";
133 }
134
135 @Override
136 public List<String> parameterNames() {
137 return Inv06.Match.parameterNames;
138 }
139
140 @Override
141 public Object[] toArray() {
142 return new Object[]{fTp};
143 }
144
145 @Override
146 public Inv06.Match toImmutable() {
147 return isMutable() ? newMatch(fTp) : this;
148 }
149
150 @Override
151 public String prettyPrint() {
152 StringBuilder result = new StringBuilder();
153 result.append("\"tp\"=" + prettyPrintValue(fTp));
154 return result.toString();
155 }
156
157 @Override
158 public int hashCode() {
159 return Objects.hash(fTp);
160 }
161
162 @Override
163 public boolean equals(final Object obj) {
164 if (this == obj)
165 return true;
166 if (obj == null) {
167 return false;
168 }
169 if ((obj instanceof Inv06.Match)) {
170 Inv06.Match other = (Inv06.Match) obj;
171 return Objects.equals(fTp, other.fTp);
172 } else {
173 // this should be infrequent
174 if (!(obj instanceof IPatternMatch)) {
175 return false;
176 }
177 IPatternMatch otherSig = (IPatternMatch) obj;
178 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
179 }
180 }
181
182 @Override
183 public Inv06 specification() {
184 return Inv06.instance();
185 }
186
187 /**
188 * Returns an empty, mutable match.
189 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
190 *
191 * @return the empty match.
192 *
193 */
194 public static Inv06.Match newEmptyMatch() {
195 return new Mutable(null);
196 }
197
198 /**
199 * Returns a mutable (partial) match.
200 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
201 *
202 * @param pTp the fixed value of pattern parameter tp, or null if not bound.
203 * @return the new, mutable (partial) match object.
204 *
205 */
206 public static Inv06.Match newMutableMatch(final Tax_Payer pTp) {
207 return new Mutable(pTp);
208 }
209
210 /**
211 * Returns a new (partial) match.
212 * This can be used e.g. to call the matcher with a partial match.
213 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
214 * @param pTp the fixed value of pattern parameter tp, or null if not bound.
215 * @return the (partial) match object.
216 *
217 */
218 public static Inv06.Match newMatch(final Tax_Payer pTp) {
219 return new Immutable(pTp);
220 }
221
222 private static final class Mutable extends Inv06.Match {
223 Mutable(final Tax_Payer pTp) {
224 super(pTp);
225 }
226
227 @Override
228 public boolean isMutable() {
229 return true;
230 }
231 }
232
233 private static final class Immutable extends Inv06.Match {
234 Immutable(final Tax_Payer pTp) {
235 super(pTp);
236 }
237
238 @Override
239 public boolean isMutable() {
240 return false;
241 }
242 }
85 } 243 }
86 244
87 /** 245 /**
@@ -189,7 +347,9 @@ public final class Inv06 extends BaseGeneratedEMFQuerySpecification<Inv06.Matche
189 * @return a match represented as a Match object, or null if no match is found. 347 * @return a match represented as a Match object, or null if no match is found.
190 * 348 *
191 */ 349 */
192 public Optional<Inv06.Match> getOneArbitraryMatch(); 350 public Optional<Inv06.Match> getOneArbitraryMatch(final Tax_Payer pTp) {
351 return rawGetOneArbitraryMatch(new Object[]{pTp});
352 }
193 353
194 /** 354 /**
195 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, 355 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,