diff options
author | 2019-08-15 15:36:05 +0200 | |
---|---|---|
committer | 2019-08-15 15:36:05 +0200 | |
commit | 110268c8e8937df8d67075caebd6d31460d0f81a (patch) | |
tree | f52bd65d0cc8516e5fb1f68c5cdf1e89d6390ebd /Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java | |
parent | Measurements WIP (diff) | |
download | VIATRA-Generator-110268c8e8937df8d67075caebd6d31460d0f81a.tar.gz VIATRA-Generator-110268c8e8937df8d67075caebd6d31460d0f81a.tar.zst VIATRA-Generator-110268c8e8937df8d67075caebd6d31460d0f81a.zip |
Measurements WIP
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java | 533 |
1 files changed, 533 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java new file mode 100644 index 00000000..ad04c098 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java | |||
@@ -0,0 +1,533 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
36 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
37 | |||
38 | /** | ||
39 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
40 | * | ||
41 | * <p>Original source: | ||
42 | * <code><pre> | ||
43 | * pattern dir(d: Dir) { | ||
44 | * Dir(d); | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see Matcher | ||
49 | * @see Match | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class Dir extends BaseGeneratedEMFQuerySpecification<Dir.Matcher> { | ||
54 | /** | ||
55 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir pattern, | ||
56 | * to be used in conjunction with {@link Matcher}. | ||
57 | * | ||
58 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
59 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
60 | * usable to represent a match of the pattern in the result of a query, | ||
61 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
62 | * | ||
63 | * @see Matcher | ||
64 | * | ||
65 | */ | ||
66 | public static abstract class Match extends BasePatternMatch { | ||
67 | private hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir fD; | ||
68 | |||
69 | private static List<String> parameterNames = makeImmutableList("d"); | ||
70 | |||
71 | private Match(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
72 | this.fD = pD; | ||
73 | } | ||
74 | |||
75 | @Override | ||
76 | public Object get(final String parameterName) { | ||
77 | if ("d".equals(parameterName)) return this.fD; | ||
78 | return null; | ||
79 | } | ||
80 | |||
81 | public hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir getD() { | ||
82 | return this.fD; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public boolean set(final String parameterName, final Object newValue) { | ||
87 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
88 | if ("d".equals(parameterName) ) { | ||
89 | this.fD = (hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) newValue; | ||
90 | return true; | ||
91 | } | ||
92 | return false; | ||
93 | } | ||
94 | |||
95 | public void setD(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
96 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
97 | this.fD = pD; | ||
98 | } | ||
99 | |||
100 | @Override | ||
101 | public String patternName() { | ||
102 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> parameterNames() { | ||
107 | return Dir.Match.parameterNames; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public Object[] toArray() { | ||
112 | return new Object[]{fD}; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Dir.Match toImmutable() { | ||
117 | return isMutable() ? newMatch(fD) : this; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public String prettyPrint() { | ||
122 | StringBuilder result = new StringBuilder(); | ||
123 | result.append("\"d\"=" + prettyPrintValue(fD)); | ||
124 | return result.toString(); | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public int hashCode() { | ||
129 | return Objects.hash(fD); | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public boolean equals(final Object obj) { | ||
134 | if (this == obj) | ||
135 | return true; | ||
136 | if (obj == null) { | ||
137 | return false; | ||
138 | } | ||
139 | if ((obj instanceof Dir.Match)) { | ||
140 | Dir.Match other = (Dir.Match) obj; | ||
141 | return Objects.equals(fD, other.fD); | ||
142 | } else { | ||
143 | // this should be infrequent | ||
144 | if (!(obj instanceof IPatternMatch)) { | ||
145 | return false; | ||
146 | } | ||
147 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
148 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | @Override | ||
153 | public Dir specification() { | ||
154 | return Dir.instance(); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * Returns an empty, mutable match. | ||
159 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
160 | * | ||
161 | * @return the empty match. | ||
162 | * | ||
163 | */ | ||
164 | public static Dir.Match newEmptyMatch() { | ||
165 | return new Mutable(null); | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * Returns a mutable (partial) match. | ||
170 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
171 | * | ||
172 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
173 | * @return the new, mutable (partial) match object. | ||
174 | * | ||
175 | */ | ||
176 | public static Dir.Match newMutableMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
177 | return new Mutable(pD); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns a new (partial) match. | ||
182 | * This can be used e.g. to call the matcher with a partial match. | ||
183 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
184 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
185 | * @return the (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static Dir.Match newMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
189 | return new Immutable(pD); | ||
190 | } | ||
191 | |||
192 | private static final class Mutable extends Dir.Match { | ||
193 | Mutable(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
194 | super(pD); | ||
195 | } | ||
196 | |||
197 | @Override | ||
198 | public boolean isMutable() { | ||
199 | return true; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | private static final class Immutable extends Dir.Match { | ||
204 | Immutable(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
205 | super(pD); | ||
206 | } | ||
207 | |||
208 | @Override | ||
209 | public boolean isMutable() { | ||
210 | return false; | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir pattern, | ||
217 | * providing pattern-specific query methods. | ||
218 | * | ||
219 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
220 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
221 | * | ||
222 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
223 | * | ||
224 | * <p>Original source: | ||
225 | * <code><pre> | ||
226 | * pattern dir(d: Dir) { | ||
227 | * Dir(d); | ||
228 | * } | ||
229 | * </pre></code> | ||
230 | * | ||
231 | * @see Match | ||
232 | * @see Dir | ||
233 | * | ||
234 | */ | ||
235 | public static class Matcher extends BaseMatcher<Dir.Match> { | ||
236 | /** | ||
237 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
238 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
239 | * | ||
240 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
241 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
242 | * | ||
243 | */ | ||
244 | public static Dir.Matcher on(final ViatraQueryEngine engine) { | ||
245 | // check if matcher already exists | ||
246 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
247 | if (matcher == null) { | ||
248 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
249 | } | ||
250 | return matcher; | ||
251 | } | ||
252 | |||
253 | /** | ||
254 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
255 | * @return an initialized matcher | ||
256 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
257 | * | ||
258 | */ | ||
259 | public static Dir.Matcher create() { | ||
260 | return new Matcher(); | ||
261 | } | ||
262 | |||
263 | private static final int POSITION_D = 0; | ||
264 | |||
265 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Dir.Matcher.class); | ||
266 | |||
267 | /** | ||
268 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
269 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
270 | * | ||
271 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
272 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
273 | * | ||
274 | */ | ||
275 | private Matcher() { | ||
276 | super(querySpecification()); | ||
277 | } | ||
278 | |||
279 | /** | ||
280 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
281 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
282 | * @return matches represented as a Match object. | ||
283 | * | ||
284 | */ | ||
285 | public Collection<Dir.Match> getAllMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
286 | return rawStreamAllMatches(new Object[]{pD}).collect(Collectors.toSet()); | ||
287 | } | ||
288 | |||
289 | /** | ||
290 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
291 | * </p> | ||
292 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
293 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
294 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
295 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
296 | * @return a stream of matches represented as a Match object. | ||
297 | * | ||
298 | */ | ||
299 | public Stream<Dir.Match> streamAllMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
300 | return rawStreamAllMatches(new Object[]{pD}); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
305 | * Neither determinism nor randomness of selection is guaranteed. | ||
306 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
307 | * @return a match represented as a Match object, or null if no match is found. | ||
308 | * | ||
309 | */ | ||
310 | public Optional<Dir.Match> getOneArbitraryMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
311 | return rawGetOneArbitraryMatch(new Object[]{pD}); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
316 | * under any possible substitution of the unspecified parameters (if any). | ||
317 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
318 | * @return true if the input is a valid (partial) match of the pattern. | ||
319 | * | ||
320 | */ | ||
321 | public boolean hasMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
322 | return rawHasMatch(new Object[]{pD}); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
327 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
328 | * @return the number of pattern matches found. | ||
329 | * | ||
330 | */ | ||
331 | public int countMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
332 | return rawCountMatches(new Object[]{pD}); | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
337 | * Neither determinism nor randomness of selection is guaranteed. | ||
338 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
339 | * @param processor the action that will process the selected match. | ||
340 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
341 | * | ||
342 | */ | ||
343 | public boolean forOneArbitraryMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD, final Consumer<? super Dir.Match> processor) { | ||
344 | return rawForOneArbitraryMatch(new Object[]{pD}, processor); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Returns a new (partial) match. | ||
349 | * This can be used e.g. to call the matcher with a partial match. | ||
350 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
351 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
352 | * @return the (partial) match object. | ||
353 | * | ||
354 | */ | ||
355 | public Dir.Match newMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
356 | return Dir.Match.newMatch(pD); | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * Retrieve the set of values that occur in matches for d. | ||
361 | * @return the Set of all values or empty set if there are no matches | ||
362 | * | ||
363 | */ | ||
364 | protected Stream<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> rawStreamAllValuesOfd(final Object[] parameters) { | ||
365 | return rawStreamAllValues(POSITION_D, parameters).map(hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir.class::cast); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * Retrieve the set of values that occur in matches for d. | ||
370 | * @return the Set of all values or empty set if there are no matches | ||
371 | * | ||
372 | */ | ||
373 | public Set<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> getAllValuesOfd() { | ||
374 | return rawStreamAllValuesOfd(emptyArray()).collect(Collectors.toSet()); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Retrieve the set of values that occur in matches for d. | ||
379 | * @return the Set of all values or empty set if there are no matches | ||
380 | * | ||
381 | */ | ||
382 | public Stream<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> streamAllValuesOfd() { | ||
383 | return rawStreamAllValuesOfd(emptyArray()); | ||
384 | } | ||
385 | |||
386 | @Override | ||
387 | protected Dir.Match tupleToMatch(final Tuple t) { | ||
388 | try { | ||
389 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) t.get(POSITION_D)); | ||
390 | } catch(ClassCastException e) { | ||
391 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
392 | return null; | ||
393 | } | ||
394 | } | ||
395 | |||
396 | @Override | ||
397 | protected Dir.Match arrayToMatch(final Object[] match) { | ||
398 | try { | ||
399 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) match[POSITION_D]); | ||
400 | } catch(ClassCastException e) { | ||
401 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
402 | return null; | ||
403 | } | ||
404 | } | ||
405 | |||
406 | @Override | ||
407 | protected Dir.Match arrayToMatchMutable(final Object[] match) { | ||
408 | try { | ||
409 | return Dir.Match.newMutableMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) match[POSITION_D]); | ||
410 | } catch(ClassCastException e) { | ||
411 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
412 | return null; | ||
413 | } | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * @return the singleton instance of the query specification of this pattern | ||
418 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
419 | * | ||
420 | */ | ||
421 | public static IQuerySpecification<Dir.Matcher> querySpecification() { | ||
422 | return Dir.instance(); | ||
423 | } | ||
424 | } | ||
425 | |||
426 | private Dir() { | ||
427 | super(GeneratedPQuery.INSTANCE); | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * @return the singleton instance of the query specification | ||
432 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
433 | * | ||
434 | */ | ||
435 | public static Dir instance() { | ||
436 | try{ | ||
437 | return LazyHolder.INSTANCE; | ||
438 | } catch (ExceptionInInitializerError err) { | ||
439 | throw processInitializerError(err); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | @Override | ||
444 | protected Dir.Matcher instantiate(final ViatraQueryEngine engine) { | ||
445 | return Dir.Matcher.on(engine); | ||
446 | } | ||
447 | |||
448 | @Override | ||
449 | public Dir.Matcher instantiate() { | ||
450 | return Dir.Matcher.create(); | ||
451 | } | ||
452 | |||
453 | @Override | ||
454 | public Dir.Match newEmptyMatch() { | ||
455 | return Dir.Match.newEmptyMatch(); | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | public Dir.Match newMatch(final Object... parameters) { | ||
460 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) parameters[0]); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir (visibility: PUBLIC, simpleName: Dir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
465 | * <b>not</b> at the class load time of the outer class, | ||
466 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir (visibility: PUBLIC, simpleName: Dir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
467 | * | ||
468 | * <p> This workaround is required e.g. to support recursion. | ||
469 | * | ||
470 | */ | ||
471 | private static class LazyHolder { | ||
472 | private static final Dir INSTANCE = new Dir(); | ||
473 | |||
474 | /** | ||
475 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
476 | * This initialization order is required to support indirect recursion. | ||
477 | * | ||
478 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
479 | * | ||
480 | */ | ||
481 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
482 | |||
483 | public static Object ensureInitialized() { | ||
484 | INSTANCE.ensureInitializedInternal(); | ||
485 | return null; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
490 | private static final Dir.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
491 | |||
492 | private final PParameter parameter_d = new PParameter("d", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "Dir")), PParameterDirection.INOUT); | ||
493 | |||
494 | private final List<PParameter> parameters = Arrays.asList(parameter_d); | ||
495 | |||
496 | private GeneratedPQuery() { | ||
497 | super(PVisibility.PUBLIC); | ||
498 | } | ||
499 | |||
500 | @Override | ||
501 | public String getFullyQualifiedName() { | ||
502 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir"; | ||
503 | } | ||
504 | |||
505 | @Override | ||
506 | public List<String> getParameterNames() { | ||
507 | return Arrays.asList("d"); | ||
508 | } | ||
509 | |||
510 | @Override | ||
511 | public List<PParameter> getParameters() { | ||
512 | return parameters; | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public Set<PBody> doGetContainedBodies() { | ||
517 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
518 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
519 | { | ||
520 | PBody body = new PBody(this); | ||
521 | PVariable var_d = body.getOrCreateVariableByName("d"); | ||
522 | new TypeConstraint(body, Tuples.flatTupleOf(var_d), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
523 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
524 | new ExportedParameter(body, var_d, parameter_d) | ||
525 | )); | ||
526 | // Dir(d) | ||
527 | new TypeConstraint(body, Tuples.flatTupleOf(var_d), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
528 | bodies.add(body); | ||
529 | } | ||
530 | return bodies; | ||
531 | } | ||
532 | } | ||
533 | } | ||