diff options
author | 2019-06-09 14:45:02 -0400 | |
---|---|---|
committer | 2019-06-09 14:45:02 -0400 | |
commit | 555987a459702674da350fa1fd5f76ffe14cd7c0 (patch) | |
tree | c64f2af9d655eb94b1a13d8c22f67bbf34435e0f /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java | |
parent | Trying to simplify Satellite case study (diff) | |
download | VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.tar.gz VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.tar.zst VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.zip |
Simplify satellite metamodel further
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java | 165 |
1 files changed, 78 insertions, 87 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java index c9dd1e58..af53fc9f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java | |||
@@ -40,7 +40,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | |||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | 40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; |
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | 41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; |
42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | 42 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; |
43 | import satellite.DirectedCommunicationLink; | 43 | import satellite.CommSubsystem; |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | 46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. |
@@ -49,11 +49,10 @@ import satellite.DirectedCommunicationLink; | |||
49 | * <code><pre> | 49 | * <code><pre> |
50 | * // Source and target communication systems must be compatible. | 50 | * // Source and target communication systems must be compatible. |
51 | * | 51 | * |
52 | * {@literal @}Constraint(severity = "error", key = {Link}, | 52 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, |
53 | * message = "Two ends of a communication link must use the same band.") | 53 | * message = "Two ends of a communication link must use the same band.") |
54 | * pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | 54 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { |
55 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | 55 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
56 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
57 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | 56 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); |
58 | * } | 57 | * } |
59 | * </pre></code> | 58 | * </pre></code> |
@@ -77,37 +76,37 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
77 | * | 76 | * |
78 | */ | 77 | */ |
79 | public static abstract class Match extends BasePatternMatch { | 78 | public static abstract class Match extends BasePatternMatch { |
80 | private DirectedCommunicationLink fLink; | 79 | private CommSubsystem fSourceSubsystem; |
81 | 80 | ||
82 | private static List<String> parameterNames = makeImmutableList("Link"); | 81 | private static List<String> parameterNames = makeImmutableList("SourceSubsystem"); |
83 | 82 | ||
84 | private Match(final DirectedCommunicationLink pLink) { | 83 | private Match(final CommSubsystem pSourceSubsystem) { |
85 | this.fLink = pLink; | 84 | this.fSourceSubsystem = pSourceSubsystem; |
86 | } | 85 | } |
87 | 86 | ||
88 | @Override | 87 | @Override |
89 | public Object get(final String parameterName) { | 88 | public Object get(final String parameterName) { |
90 | if ("Link".equals(parameterName)) return this.fLink; | 89 | if ("SourceSubsystem".equals(parameterName)) return this.fSourceSubsystem; |
91 | return null; | 90 | return null; |
92 | } | 91 | } |
93 | 92 | ||
94 | public DirectedCommunicationLink getLink() { | 93 | public CommSubsystem getSourceSubsystem() { |
95 | return this.fLink; | 94 | return this.fSourceSubsystem; |
96 | } | 95 | } |
97 | 96 | ||
98 | @Override | 97 | @Override |
99 | public boolean set(final String parameterName, final Object newValue) { | 98 | public boolean set(final String parameterName, final Object newValue) { |
100 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
101 | if ("Link".equals(parameterName) ) { | 100 | if ("SourceSubsystem".equals(parameterName) ) { |
102 | this.fLink = (DirectedCommunicationLink) newValue; | 101 | this.fSourceSubsystem = (CommSubsystem) newValue; |
103 | return true; | 102 | return true; |
104 | } | 103 | } |
105 | return false; | 104 | return false; |
106 | } | 105 | } |
107 | 106 | ||
108 | public void setLink(final DirectedCommunicationLink pLink) { | 107 | public void setSourceSubsystem(final CommSubsystem pSourceSubsystem) { |
109 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | 108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); |
110 | this.fLink = pLink; | 109 | this.fSourceSubsystem = pSourceSubsystem; |
111 | } | 110 | } |
112 | 111 | ||
113 | @Override | 112 | @Override |
@@ -122,24 +121,24 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
122 | 121 | ||
123 | @Override | 122 | @Override |
124 | public Object[] toArray() { | 123 | public Object[] toArray() { |
125 | return new Object[]{fLink}; | 124 | return new Object[]{fSourceSubsystem}; |
126 | } | 125 | } |
127 | 126 | ||
128 | @Override | 127 | @Override |
129 | public IncompatibleSourceAndTargetBand.Match toImmutable() { | 128 | public IncompatibleSourceAndTargetBand.Match toImmutable() { |
130 | return isMutable() ? newMatch(fLink) : this; | 129 | return isMutable() ? newMatch(fSourceSubsystem) : this; |
131 | } | 130 | } |
132 | 131 | ||
133 | @Override | 132 | @Override |
134 | public String prettyPrint() { | 133 | public String prettyPrint() { |
135 | StringBuilder result = new StringBuilder(); | 134 | StringBuilder result = new StringBuilder(); |
136 | result.append("\"Link\"=" + prettyPrintValue(fLink)); | 135 | result.append("\"SourceSubsystem\"=" + prettyPrintValue(fSourceSubsystem)); |
137 | return result.toString(); | 136 | return result.toString(); |
138 | } | 137 | } |
139 | 138 | ||
140 | @Override | 139 | @Override |
141 | public int hashCode() { | 140 | public int hashCode() { |
142 | return Objects.hash(fLink); | 141 | return Objects.hash(fSourceSubsystem); |
143 | } | 142 | } |
144 | 143 | ||
145 | @Override | 144 | @Override |
@@ -151,7 +150,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
151 | } | 150 | } |
152 | if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) { | 151 | if ((obj instanceof IncompatibleSourceAndTargetBand.Match)) { |
153 | IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj; | 152 | IncompatibleSourceAndTargetBand.Match other = (IncompatibleSourceAndTargetBand.Match) obj; |
154 | return Objects.equals(fLink, other.fLink); | 153 | return Objects.equals(fSourceSubsystem, other.fSourceSubsystem); |
155 | } else { | 154 | } else { |
156 | // this should be infrequent | 155 | // this should be infrequent |
157 | if (!(obj instanceof IPatternMatch)) { | 156 | if (!(obj instanceof IPatternMatch)) { |
@@ -182,29 +181,29 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
182 | * Returns a mutable (partial) match. | 181 | * Returns a mutable (partial) match. |
183 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | 182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. |
184 | * | 183 | * |
185 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 184 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
186 | * @return the new, mutable (partial) match object. | 185 | * @return the new, mutable (partial) match object. |
187 | * | 186 | * |
188 | */ | 187 | */ |
189 | public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final DirectedCommunicationLink pLink) { | 188 | public static IncompatibleSourceAndTargetBand.Match newMutableMatch(final CommSubsystem pSourceSubsystem) { |
190 | return new Mutable(pLink); | 189 | return new Mutable(pSourceSubsystem); |
191 | } | 190 | } |
192 | 191 | ||
193 | /** | 192 | /** |
194 | * Returns a new (partial) match. | 193 | * Returns a new (partial) match. |
195 | * This can be used e.g. to call the matcher with a partial match. | 194 | * This can be used e.g. to call the matcher with a partial match. |
196 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | 195 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
197 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 196 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
198 | * @return the (partial) match object. | 197 | * @return the (partial) match object. |
199 | * | 198 | * |
200 | */ | 199 | */ |
201 | public static IncompatibleSourceAndTargetBand.Match newMatch(final DirectedCommunicationLink pLink) { | 200 | public static IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { |
202 | return new Immutable(pLink); | 201 | return new Immutable(pSourceSubsystem); |
203 | } | 202 | } |
204 | 203 | ||
205 | private static final class Mutable extends IncompatibleSourceAndTargetBand.Match { | 204 | private static final class Mutable extends IncompatibleSourceAndTargetBand.Match { |
206 | Mutable(final DirectedCommunicationLink pLink) { | 205 | Mutable(final CommSubsystem pSourceSubsystem) { |
207 | super(pLink); | 206 | super(pSourceSubsystem); |
208 | } | 207 | } |
209 | 208 | ||
210 | @Override | 209 | @Override |
@@ -214,8 +213,8 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
214 | } | 213 | } |
215 | 214 | ||
216 | private static final class Immutable extends IncompatibleSourceAndTargetBand.Match { | 215 | private static final class Immutable extends IncompatibleSourceAndTargetBand.Match { |
217 | Immutable(final DirectedCommunicationLink pLink) { | 216 | Immutable(final CommSubsystem pSourceSubsystem) { |
218 | super(pLink); | 217 | super(pSourceSubsystem); |
219 | } | 218 | } |
220 | 219 | ||
221 | @Override | 220 | @Override |
@@ -238,11 +237,10 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
238 | * <code><pre> | 237 | * <code><pre> |
239 | * // Source and target communication systems must be compatible. | 238 | * // Source and target communication systems must be compatible. |
240 | * | 239 | * |
241 | * {@literal @}Constraint(severity = "error", key = {Link}, | 240 | * {@literal @}Constraint(severity = "error", key = {SourceSubsystem}, |
242 | * message = "Two ends of a communication link must use the same band.") | 241 | * message = "Two ends of a communication link must use the same band.") |
243 | * pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | 242 | * pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { |
244 | * DirectedCommunicationLink.source(Link, SourceSubsystem); | 243 | * CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
245 | * DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
246 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | 244 | * neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); |
247 | * } | 245 | * } |
248 | * </pre></code> | 246 | * </pre></code> |
@@ -279,7 +277,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
279 | return new Matcher(); | 277 | return new Matcher(); |
280 | } | 278 | } |
281 | 279 | ||
282 | private static final int POSITION_LINK = 0; | 280 | private static final int POSITION_SOURCESUBSYSTEM = 0; |
283 | 281 | ||
284 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class); | 282 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(IncompatibleSourceAndTargetBand.Matcher.class); |
285 | 283 | ||
@@ -297,12 +295,12 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
297 | 295 | ||
298 | /** | 296 | /** |
299 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | 297 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. |
300 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 298 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
301 | * @return matches represented as a Match object. | 299 | * @return matches represented as a Match object. |
302 | * | 300 | * |
303 | */ | 301 | */ |
304 | public Collection<IncompatibleSourceAndTargetBand.Match> getAllMatches(final DirectedCommunicationLink pLink) { | 302 | public Collection<IncompatibleSourceAndTargetBand.Match> getAllMatches(final CommSubsystem pSourceSubsystem) { |
305 | return rawStreamAllMatches(new Object[]{pLink}).collect(Collectors.toSet()); | 303 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}).collect(Collectors.toSet()); |
306 | } | 304 | } |
307 | 305 | ||
308 | /** | 306 | /** |
@@ -311,101 +309,101 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
311 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | 309 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. |
312 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | 310 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. |
313 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | 311 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. |
314 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 312 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
315 | * @return a stream of matches represented as a Match object. | 313 | * @return a stream of matches represented as a Match object. |
316 | * | 314 | * |
317 | */ | 315 | */ |
318 | public Stream<IncompatibleSourceAndTargetBand.Match> streamAllMatches(final DirectedCommunicationLink pLink) { | 316 | public Stream<IncompatibleSourceAndTargetBand.Match> streamAllMatches(final CommSubsystem pSourceSubsystem) { |
319 | return rawStreamAllMatches(new Object[]{pLink}); | 317 | return rawStreamAllMatches(new Object[]{pSourceSubsystem}); |
320 | } | 318 | } |
321 | 319 | ||
322 | /** | 320 | /** |
323 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 321 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. |
324 | * Neither determinism nor randomness of selection is guaranteed. | 322 | * Neither determinism nor randomness of selection is guaranteed. |
325 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 323 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
326 | * @return a match represented as a Match object, or null if no match is found. | 324 | * @return a match represented as a Match object, or null if no match is found. |
327 | * | 325 | * |
328 | */ | 326 | */ |
329 | public Optional<IncompatibleSourceAndTargetBand.Match> getOneArbitraryMatch(final DirectedCommunicationLink pLink) { | 327 | public Optional<IncompatibleSourceAndTargetBand.Match> getOneArbitraryMatch(final CommSubsystem pSourceSubsystem) { |
330 | return rawGetOneArbitraryMatch(new Object[]{pLink}); | 328 | return rawGetOneArbitraryMatch(new Object[]{pSourceSubsystem}); |
331 | } | 329 | } |
332 | 330 | ||
333 | /** | 331 | /** |
334 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | 332 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, |
335 | * under any possible substitution of the unspecified parameters (if any). | 333 | * under any possible substitution of the unspecified parameters (if any). |
336 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 334 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
337 | * @return true if the input is a valid (partial) match of the pattern. | 335 | * @return true if the input is a valid (partial) match of the pattern. |
338 | * | 336 | * |
339 | */ | 337 | */ |
340 | public boolean hasMatch(final DirectedCommunicationLink pLink) { | 338 | public boolean hasMatch(final CommSubsystem pSourceSubsystem) { |
341 | return rawHasMatch(new Object[]{pLink}); | 339 | return rawHasMatch(new Object[]{pSourceSubsystem}); |
342 | } | 340 | } |
343 | 341 | ||
344 | /** | 342 | /** |
345 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | 343 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. |
346 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 344 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
347 | * @return the number of pattern matches found. | 345 | * @return the number of pattern matches found. |
348 | * | 346 | * |
349 | */ | 347 | */ |
350 | public int countMatches(final DirectedCommunicationLink pLink) { | 348 | public int countMatches(final CommSubsystem pSourceSubsystem) { |
351 | return rawCountMatches(new Object[]{pLink}); | 349 | return rawCountMatches(new Object[]{pSourceSubsystem}); |
352 | } | 350 | } |
353 | 351 | ||
354 | /** | 352 | /** |
355 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | 353 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. |
356 | * Neither determinism nor randomness of selection is guaranteed. | 354 | * Neither determinism nor randomness of selection is guaranteed. |
357 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 355 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
358 | * @param processor the action that will process the selected match. | 356 | * @param processor the action that will process the selected match. |
359 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | 357 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked |
360 | * | 358 | * |
361 | */ | 359 | */ |
362 | public boolean forOneArbitraryMatch(final DirectedCommunicationLink pLink, final Consumer<? super IncompatibleSourceAndTargetBand.Match> processor) { | 360 | public boolean forOneArbitraryMatch(final CommSubsystem pSourceSubsystem, final Consumer<? super IncompatibleSourceAndTargetBand.Match> processor) { |
363 | return rawForOneArbitraryMatch(new Object[]{pLink}, processor); | 361 | return rawForOneArbitraryMatch(new Object[]{pSourceSubsystem}, processor); |
364 | } | 362 | } |
365 | 363 | ||
366 | /** | 364 | /** |
367 | * Returns a new (partial) match. | 365 | * Returns a new (partial) match. |
368 | * This can be used e.g. to call the matcher with a partial match. | 366 | * This can be used e.g. to call the matcher with a partial match. |
369 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | 367 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. |
370 | * @param pLink the fixed value of pattern parameter Link, or null if not bound. | 368 | * @param pSourceSubsystem the fixed value of pattern parameter SourceSubsystem, or null if not bound. |
371 | * @return the (partial) match object. | 369 | * @return the (partial) match object. |
372 | * | 370 | * |
373 | */ | 371 | */ |
374 | public IncompatibleSourceAndTargetBand.Match newMatch(final DirectedCommunicationLink pLink) { | 372 | public IncompatibleSourceAndTargetBand.Match newMatch(final CommSubsystem pSourceSubsystem) { |
375 | return IncompatibleSourceAndTargetBand.Match.newMatch(pLink); | 373 | return IncompatibleSourceAndTargetBand.Match.newMatch(pSourceSubsystem); |
376 | } | 374 | } |
377 | 375 | ||
378 | /** | 376 | /** |
379 | * Retrieve the set of values that occur in matches for Link. | 377 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
380 | * @return the Set of all values or empty set if there are no matches | 378 | * @return the Set of all values or empty set if there are no matches |
381 | * | 379 | * |
382 | */ | 380 | */ |
383 | protected Stream<DirectedCommunicationLink> rawStreamAllValuesOfLink(final Object[] parameters) { | 381 | protected Stream<CommSubsystem> rawStreamAllValuesOfSourceSubsystem(final Object[] parameters) { |
384 | return rawStreamAllValues(POSITION_LINK, parameters).map(DirectedCommunicationLink.class::cast); | 382 | return rawStreamAllValues(POSITION_SOURCESUBSYSTEM, parameters).map(CommSubsystem.class::cast); |
385 | } | 383 | } |
386 | 384 | ||
387 | /** | 385 | /** |
388 | * Retrieve the set of values that occur in matches for Link. | 386 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
389 | * @return the Set of all values or empty set if there are no matches | 387 | * @return the Set of all values or empty set if there are no matches |
390 | * | 388 | * |
391 | */ | 389 | */ |
392 | public Set<DirectedCommunicationLink> getAllValuesOfLink() { | 390 | public Set<CommSubsystem> getAllValuesOfSourceSubsystem() { |
393 | return rawStreamAllValuesOfLink(emptyArray()).collect(Collectors.toSet()); | 391 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()).collect(Collectors.toSet()); |
394 | } | 392 | } |
395 | 393 | ||
396 | /** | 394 | /** |
397 | * Retrieve the set of values that occur in matches for Link. | 395 | * Retrieve the set of values that occur in matches for SourceSubsystem. |
398 | * @return the Set of all values or empty set if there are no matches | 396 | * @return the Set of all values or empty set if there are no matches |
399 | * | 397 | * |
400 | */ | 398 | */ |
401 | public Stream<DirectedCommunicationLink> streamAllValuesOfLink() { | 399 | public Stream<CommSubsystem> streamAllValuesOfSourceSubsystem() { |
402 | return rawStreamAllValuesOfLink(emptyArray()); | 400 | return rawStreamAllValuesOfSourceSubsystem(emptyArray()); |
403 | } | 401 | } |
404 | 402 | ||
405 | @Override | 403 | @Override |
406 | protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) { | 404 | protected IncompatibleSourceAndTargetBand.Match tupleToMatch(final Tuple t) { |
407 | try { | 405 | try { |
408 | return IncompatibleSourceAndTargetBand.Match.newMatch((DirectedCommunicationLink) t.get(POSITION_LINK)); | 406 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) t.get(POSITION_SOURCESUBSYSTEM)); |
409 | } catch(ClassCastException e) { | 407 | } catch(ClassCastException e) { |
410 | LOGGER.error("Element(s) in tuple not properly typed!",e); | 408 | LOGGER.error("Element(s) in tuple not properly typed!",e); |
411 | return null; | 409 | return null; |
@@ -415,7 +413,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
415 | @Override | 413 | @Override |
416 | protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) { | 414 | protected IncompatibleSourceAndTargetBand.Match arrayToMatch(final Object[] match) { |
417 | try { | 415 | try { |
418 | return IncompatibleSourceAndTargetBand.Match.newMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 416 | return IncompatibleSourceAndTargetBand.Match.newMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); |
419 | } catch(ClassCastException e) { | 417 | } catch(ClassCastException e) { |
420 | LOGGER.error("Element(s) in array not properly typed!",e); | 418 | LOGGER.error("Element(s) in array not properly typed!",e); |
421 | return null; | 419 | return null; |
@@ -425,7 +423,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
425 | @Override | 423 | @Override |
426 | protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) { | 424 | protected IncompatibleSourceAndTargetBand.Match arrayToMatchMutable(final Object[] match) { |
427 | try { | 425 | try { |
428 | return IncompatibleSourceAndTargetBand.Match.newMutableMatch((DirectedCommunicationLink) match[POSITION_LINK]); | 426 | return IncompatibleSourceAndTargetBand.Match.newMutableMatch((CommSubsystem) match[POSITION_SOURCESUBSYSTEM]); |
429 | } catch(ClassCastException e) { | 427 | } catch(ClassCastException e) { |
430 | LOGGER.error("Element(s) in array not properly typed!",e); | 428 | LOGGER.error("Element(s) in array not properly typed!",e); |
431 | return null; | 429 | return null; |
@@ -476,7 +474,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
476 | 474 | ||
477 | @Override | 475 | @Override |
478 | public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { | 476 | public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { |
479 | return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.DirectedCommunicationLink) parameters[0]); | 477 | return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.CommSubsystem) parameters[0]); |
480 | } | 478 | } |
481 | 479 | ||
482 | /** | 480 | /** |
@@ -508,9 +506,9 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
508 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | 506 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { |
509 | private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | 507 | private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); |
510 | 508 | ||
511 | private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); | 509 | private final PParameter parameter_SourceSubsystem = new PParameter("SourceSubsystem", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); |
512 | 510 | ||
513 | private final List<PParameter> parameters = Arrays.asList(parameter_Link); | 511 | private final List<PParameter> parameters = Arrays.asList(parameter_SourceSubsystem); |
514 | 512 | ||
515 | private GeneratedPQuery() { | 513 | private GeneratedPQuery() { |
516 | super(PVisibility.PUBLIC); | 514 | super(PVisibility.PUBLIC); |
@@ -523,7 +521,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
523 | 521 | ||
524 | @Override | 522 | @Override |
525 | public List<String> getParameterNames() { | 523 | public List<String> getParameterNames() { |
526 | return Arrays.asList("Link"); | 524 | return Arrays.asList("SourceSubsystem"); |
527 | } | 525 | } |
528 | 526 | ||
529 | @Override | 527 | @Override |
@@ -537,25 +535,18 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
537 | Set<PBody> bodies = new LinkedHashSet<>(); | 535 | Set<PBody> bodies = new LinkedHashSet<>(); |
538 | { | 536 | { |
539 | PBody body = new PBody(this); | 537 | PBody body = new PBody(this); |
540 | PVariable var_Link = body.getOrCreateVariableByName("Link"); | ||
541 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); | 538 | PVariable var_SourceSubsystem = body.getOrCreateVariableByName("SourceSubsystem"); |
542 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); | 539 | PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem"); |
543 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 540 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
544 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | 541 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( |
545 | new ExportedParameter(body, var_Link, parameter_Link) | 542 | new ExportedParameter(body, var_SourceSubsystem, parameter_SourceSubsystem) |
546 | )); | 543 | )); |
547 | // DirectedCommunicationLink.source(Link, SourceSubsystem) | 544 | // CommSubsystem.target(SourceSubsystem, TargetSubsystem) |
548 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | 545 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
549 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | 546 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); |
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); | 547 | new TypeConstraint(body, Tuples.flatTupleOf(var_SourceSubsystem, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "target"))); |
551 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | 548 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); |
552 | new Equality(body, var__virtual_0_, var_SourceSubsystem); | 549 | new Equality(body, var__virtual_0_, var_TargetSubsystem); |
553 | // DirectedCommunicationLink.target(Link, TargetSubsystem) | ||
554 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); | ||
555 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target"))); | ||
557 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); | ||
558 | new Equality(body, var__virtual_1_, var_TargetSubsystem); | ||
559 | // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem) | 550 | // neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem) |
560 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); | 551 | new NegativePatternCall(body, Tuples.flatTupleOf(var_SourceSubsystem, var_TargetSubsystem), MatchingCommSubsystem.instance().getInternalQueryRepresentation()); |
561 | bodies.add(body); | 552 | bodies.add(body); |
@@ -564,7 +555,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery | |||
564 | PAnnotation annotation = new PAnnotation("Constraint"); | 555 | PAnnotation annotation = new PAnnotation("Constraint"); |
565 | annotation.addAttribute("severity", "error"); | 556 | annotation.addAttribute("severity", "error"); |
566 | annotation.addAttribute("key", Arrays.asList(new Object[] { | 557 | annotation.addAttribute("key", Arrays.asList(new Object[] { |
567 | new ParameterReference("Link") | 558 | new ParameterReference("SourceSubsystem") |
568 | })); | 559 | })); |
569 | annotation.addAttribute("message", "Two ends of a communication link must use the same band."); | 560 | annotation.addAttribute("message", "Two ends of a communication link must use the same band."); |
570 | addAnnotation(annotation); | 561 | addAnnotation(annotation); |