Class ExternalEntityThroughExternalEntityComm.Matcher
- All Implemented Interfaces:
org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher<ExternalEntityThroughExternalEntityComm.Match>
- Enclosing class:
ExternalEntityThroughExternalEntityComm
Use the pattern matcher on a given model via on(ViatraQueryEngine),
e.g. in conjunction with ViatraQueryEngine.on(QueryScope).
Matches of the pattern will be represented as ExternalEntityThroughExternalEntityComm.Match.
Original source:
pattern externalEntityThroughExternalEntityComm(location : ExternalEntity, p2 : ExternalEntity, df : DataFlow,
t : ThreatType) {
ExternalEntity(location); ExternalEntity(p2); DataFlow(df);
find threatApplicable(location,t,"ExternalEntityThroughExternalEntity");
find communication(location,df,p2);
find flowContainerDiff(location,p2);
}
or {
// add inverse direction
ExternalEntity(location); ExternalEntity(p2); DataFlow(df);
find threatApplicable(location,t,"ExternalEntityThroughExternalEntity");
find communication(p2,df,location);
find flowContainerDiff(location,p2);
}
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher
engine, querySpecificationFields inherited from class org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper
backend -
Method Summary
Modifier and TypeMethodDescriptionarrayToMatch(Object[] match) arrayToMatchMutable(Object[] match) intcountMatches(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.create()booleanforOneArbitraryMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT, Consumer<? super ExternalEntityThroughExternalEntityComm.Match> processor) Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.getAllMatches(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.Retrieve the set of values that occur in matches for df.Retrieve the set of values that occur in matches for df.getAllValuesOfdf(ExternalEntity pLocation, ExternalEntity pP2, ThreatType pT) Retrieve the set of values that occur in matches for df.Retrieve the set of values that occur in matches for location.Retrieve the set of values that occur in matches for location.getAllValuesOflocation(ExternalEntity pP2, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for location.Retrieve the set of values that occur in matches for p2.Retrieve the set of values that occur in matches for p2.getAllValuesOfp2(ExternalEntity pLocation, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for p2.Retrieve the set of values that occur in matches for t.getAllValuesOft(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for t.getAllValuesOft(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf) Retrieve the set of values that occur in matches for t.getOneArbitraryMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.booleanhasMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, under any possible substitution of the unspecified parameters (if any).newMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns a new (partial) match.on(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine) Initializes the pattern matcher within an existing VIATRA Query engine.static org.eclipse.viatra.query.runtime.api.IQuerySpecification<ExternalEntityThroughExternalEntityComm.Matcher> rawStreamAllValuesOfdf(Object[] parameters) Retrieve the set of values that occur in matches for df.protected Stream<ExternalEntity> rawStreamAllValuesOflocation(Object[] parameters) Retrieve the set of values that occur in matches for location.protected Stream<ExternalEntity> rawStreamAllValuesOfp2(Object[] parameters) Retrieve the set of values that occur in matches for p2.protected Stream<ThreatType> rawStreamAllValuesOft(Object[] parameters) Retrieve the set of values that occur in matches for t.streamAllMatches(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.Retrieve the set of values that occur in matches for df.Retrieve the set of values that occur in matches for df.streamAllValuesOfdf(ExternalEntity pLocation, ExternalEntity pP2, ThreatType pT) Retrieve the set of values that occur in matches for df.Retrieve the set of values that occur in matches for location.Retrieve the set of values that occur in matches for location.streamAllValuesOflocation(ExternalEntity pP2, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for location.Retrieve the set of values that occur in matches for p2.Retrieve the set of values that occur in matches for p2.streamAllValuesOfp2(ExternalEntity pLocation, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for p2.Retrieve the set of values that occur in matches for t.Retrieve the set of values that occur in matches for t.streamAllValuesOft(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf) Retrieve the set of values that occur in matches for t.tupleToMatch(org.eclipse.viatra.query.runtime.matchers.tuple.Tuple t) Methods inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher
countMatches, countMatches, emptyArray, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getCapabilities, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetOneArbitraryMatch, rawHasMatch, rawStreamAllMatches, rawStreamAllValues, setBackend, streamAllMatches, streamAllMatches
-
Method Details
-
on
public static ExternalEntityThroughExternalEntityComm.Matcher on(org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine) Initializes the pattern matcher within an existing VIATRA Query engine. If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.- Parameters:
engine- the existing VIATRA Query engine in which this matcher will be created.
-
create
- Returns:
- an initialized matcher
-
getAllMatches
public Collection<ExternalEntityThroughExternalEntityComm.Match> getAllMatches(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- matches represented as a Match object.
-
streamAllMatches
public Stream<ExternalEntityThroughExternalEntityComm.Match> streamAllMatches(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- a stream of matches represented as a Match object.
-
getOneArbitraryMatch
public Optional<ExternalEntityThroughExternalEntityComm.Match> getOneArbitraryMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- a match represented as a Match object, or null if no match is found.
-
hasMatch
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, under any possible substitution of the unspecified parameters (if any).- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- true if the input is a valid (partial) match of the pattern.
-
countMatches
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- the number of pattern matches found.
-
forOneArbitraryMatch
public boolean forOneArbitraryMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT, Consumer<? super ExternalEntityThroughExternalEntityComm.Match> processor) Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.processor- the action that will process the selected match.- Returns:
- true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
-
newMatch
public ExternalEntityThroughExternalEntityComm.Match newMatch(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf, ThreatType pT) Returns a new (partial) match. This can be used e.g. to call the matcher with a partial match.The returned match will be immutable. Use
BaseMatcher.newEmptyMatch()to obtain a mutable match object.- Parameters:
pLocation- the fixed value of pattern parameter location, or null if not bound.pP2- the fixed value of pattern parameter p2, or null if not bound.pDf- the fixed value of pattern parameter df, or null if not bound.pT- the fixed value of pattern parameter t, or null if not bound.- Returns:
- the (partial) match object.
-
rawStreamAllValuesOflocation
Retrieve the set of values that occur in matches for location.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOflocation
Retrieve the set of values that occur in matches for location.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOflocation
Retrieve the set of values that occur in matches for location.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOflocation
public Stream<ExternalEntity> streamAllValuesOflocation(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for location. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
streamAllValuesOflocation
public Stream<ExternalEntity> streamAllValuesOflocation(ExternalEntity pP2, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for location. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
getAllValuesOflocation
public Set<ExternalEntity> getAllValuesOflocation(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for location.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOflocation
Retrieve the set of values that occur in matches for location.- Returns:
- the Set of all values or empty set if there are no matches
-
rawStreamAllValuesOfp2
Retrieve the set of values that occur in matches for p2.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOfp2
Retrieve the set of values that occur in matches for p2.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOfp2
Retrieve the set of values that occur in matches for p2.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOfp2
public Stream<ExternalEntity> streamAllValuesOfp2(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for p2. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
streamAllValuesOfp2
public Stream<ExternalEntity> streamAllValuesOfp2(ExternalEntity pLocation, DataFlow pDf, ThreatType pT) Retrieve the set of values that occur in matches for p2. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
getAllValuesOfp2
public Set<ExternalEntity> getAllValuesOfp2(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for p2.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOfp2
Retrieve the set of values that occur in matches for p2.- Returns:
- the Set of all values or empty set if there are no matches
-
rawStreamAllValuesOfdf
Retrieve the set of values that occur in matches for df.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOfdf
Retrieve the set of values that occur in matches for df.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOfdf
Retrieve the set of values that occur in matches for df.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOfdf
public Stream<DataFlow> streamAllValuesOfdf(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for df. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
streamAllValuesOfdf
public Stream<DataFlow> streamAllValuesOfdf(ExternalEntity pLocation, ExternalEntity pP2, ThreatType pT) Retrieve the set of values that occur in matches for df. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
getAllValuesOfdf
Retrieve the set of values that occur in matches for df.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOfdf
Retrieve the set of values that occur in matches for df.- Returns:
- the Set of all values or empty set if there are no matches
-
rawStreamAllValuesOft
Retrieve the set of values that occur in matches for t.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOft
Retrieve the set of values that occur in matches for t.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOft
Retrieve the set of values that occur in matches for t.- Returns:
- the Set of all values or empty set if there are no matches
-
streamAllValuesOft
public Stream<ThreatType> streamAllValuesOft(ExternalEntityThroughExternalEntityComm.Match partialMatch) Retrieve the set of values that occur in matches for t. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
streamAllValuesOft
public Stream<ThreatType> streamAllValuesOft(ExternalEntity pLocation, ExternalEntity pP2, DataFlow pDf) Retrieve the set of values that occur in matches for t. NOTE: It is important not to modify the source model while the stream is being processed. If the match set of the pattern changes during processing, the contents of the stream is undefined. In such cases, either rely onBaseMatcher.getAllMatches()or collect the results of the stream in end-user code.- Returns:
- the Stream of all values or empty set if there are no matches
-
getAllValuesOft
Retrieve the set of values that occur in matches for t.- Returns:
- the Set of all values or empty set if there are no matches
-
getAllValuesOft
Retrieve the set of values that occur in matches for t.- Returns:
- the Set of all values or empty set if there are no matches
-
tupleToMatch
protected ExternalEntityThroughExternalEntityComm.Match tupleToMatch(org.eclipse.viatra.query.runtime.matchers.tuple.Tuple t) - Specified by:
tupleToMatchin classorg.eclipse.viatra.query.runtime.api.impl.BaseMatcher<ExternalEntityThroughExternalEntityComm.Match>
-
arrayToMatch
- Specified by:
arrayToMatchin classorg.eclipse.viatra.query.runtime.api.impl.BaseMatcher<ExternalEntityThroughExternalEntityComm.Match>
-
arrayToMatchMutable
- Specified by:
arrayToMatchMutablein classorg.eclipse.viatra.query.runtime.api.impl.BaseMatcher<ExternalEntityThroughExternalEntityComm.Match>
-
querySpecification
public static org.eclipse.viatra.query.runtime.api.IQuerySpecification<ExternalEntityThroughExternalEntityComm.Matcher> querySpecification()- Returns:
- the singleton instance of the query specification of this pattern
-