public class LatestEventMatcher extends BaseMatcher<LatestEventMatch>
Use the pattern matcher on a given model via on(ViatraQueryEngine),
e.g. in conjunction with ViatraQueryEngine#on(Notifier).
Matches of the pattern will be represented as LatestEventMatch.
Original source:
////////////EVENT PROCESSING////////////
pattern latestEvent(event : Event) {
InternalModel.latestEvent(_, event);
}
LatestEventMatch,
LatestEventProcessor,
LatestEventQuerySpecificationengine, querySpecification| Modifier and Type | Method and Description |
|---|---|
protected LatestEventMatch |
arrayToMatch(java.lang.Object[] match)
Converts the array representation of a pattern match to an immutable Match object.
|
protected LatestEventMatch |
arrayToMatchMutable(java.lang.Object[] match)
Converts the array representation of a pattern match to a mutable Match object.
|
int |
countMatches(Event pEvent)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
static LatestEventMatcher |
create() |
void |
forEachMatch(Event pEvent,
IMatchProcessor<? super LatestEventMatch> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
forOneArbitraryMatch(Event pEvent,
IMatchProcessor<? super LatestEventMatch> processor)
Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
java.util.Collection<LatestEventMatch> |
getAllMatches(Event pEvent)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<Event> |
getAllValuesOfevent()
Retrieve the set of values that occur in matches for event.
|
LatestEventMatch |
getOneArbitraryMatch(Event pEvent)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(Event pEvent)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
LatestEventMatch |
newMatch(Event pEvent)
Returns a new (partial) match.
|
static LatestEventMatcher |
on(ViatraQueryEngine engine)
Initializes the pattern matcher within an existing VIATRA Query engine.
|
static IQuerySpecification<LatestEventMatcher> |
querySpecification() |
protected java.util.Set<Event> |
rawAccumulateAllValuesOfevent(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for event.
|
protected LatestEventMatch |
tupleToMatch(Tuple t) |
countMatches, countMatches, emptyArray, forEachMatch, forEachMatch, forOneArbitraryMatch, forOneArbitraryMatch, getAllMatches, getAllMatches, getAllValues, getAllValues, getCapabilities, getEngine, getOneArbitraryMatch, getOneArbitraryMatch, getParameterNames, getPatternName, getPositionOfParameter, getSpecification, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetAllMatches, rawGetAllValues, rawGetOneArbitraryMatch, rawHasMatch, setBackendpublic static LatestEventMatcher on(ViatraQueryEngine engine) throws ViatraQueryException
engine - the existing VIATRA Query engine in which this matcher will be created.ViatraQueryException - if an error occurs during pattern matcher creationpublic static LatestEventMatcher create() throws ViatraQueryException
ViatraQueryException - if an error occurs during pattern matcher creationpublic java.util.Collection<LatestEventMatch> getAllMatches(Event pEvent)
pEvent - the fixed value of pattern parameter event, or null if not bound.public LatestEventMatch getOneArbitraryMatch(Event pEvent)
pEvent - the fixed value of pattern parameter event, or null if not bound.public boolean hasMatch(Event pEvent)
pEvent - the fixed value of pattern parameter event, or null if not bound.public int countMatches(Event pEvent)
pEvent - the fixed value of pattern parameter event, or null if not bound.public void forEachMatch(Event pEvent, IMatchProcessor<? super LatestEventMatch> processor)
pEvent - the fixed value of pattern parameter event, or null if not bound.processor - the action that will process each pattern match.public boolean forOneArbitraryMatch(Event pEvent, IMatchProcessor<? super LatestEventMatch> processor)
pEvent - the fixed value of pattern parameter event, or null if not bound.processor - the action that will process the selected match.public LatestEventMatch newMatch(Event pEvent)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch() to obtain a mutable match object.
pEvent - the fixed value of pattern parameter event, or null if not bound.protected java.util.Set<Event> rawAccumulateAllValuesOfevent(java.lang.Object[] parameters)
public java.util.Set<Event> getAllValuesOfevent()
protected LatestEventMatch tupleToMatch(Tuple t)
tupleToMatch in class BaseMatcher<LatestEventMatch>protected LatestEventMatch arrayToMatch(java.lang.Object[] match)
BaseMatcherarrayToMatch in class BaseMatcher<LatestEventMatch>protected LatestEventMatch arrayToMatchMutable(java.lang.Object[] match)
BaseMatcherarrayToMatchMutable in class BaseMatcher<LatestEventMatch>public static IQuerySpecification<LatestEventMatcher> querySpecification() throws ViatraQueryException
ViatraQueryException - if the pattern definition could not be loaded