public class TransitionWithEventTypeMatcher extends BaseMatcher<TransitionWithEventTypeMatch>
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 TransitionWithEventTypeMatch
.
Original source:
pattern transitionWithEventType(transition : Transition, eventType : EString){
NegativeTransition.guards.eventType(transition, eventPatternReference);
AtomicEventPattern.type(eventPatternReference, eventType);
}
TransitionWithEventTypeMatch
,
TransitionWithEventTypeProcessor
,
TransitionWithEventTypeQuerySpecification
engine, querySpecification
Modifier and Type | Method and Description |
---|---|
protected TransitionWithEventTypeMatch |
arrayToMatch(java.lang.Object[] match)
Converts the array representation of a pattern match to an immutable Match object.
|
protected TransitionWithEventTypeMatch |
arrayToMatchMutable(java.lang.Object[] match)
Converts the array representation of a pattern match to a mutable Match object.
|
int |
countMatches(Transition pTransition,
java.lang.String pEventType)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
static TransitionWithEventTypeMatcher |
create() |
void |
forEachMatch(Transition pTransition,
java.lang.String pEventType,
IMatchProcessor<? super TransitionWithEventTypeMatch> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
forOneArbitraryMatch(Transition pTransition,
java.lang.String pEventType,
IMatchProcessor<? super TransitionWithEventTypeMatch> 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<TransitionWithEventTypeMatch> |
getAllMatches(Transition pTransition,
java.lang.String pEventType)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<java.lang.String> |
getAllValuesOfeventType()
Retrieve the set of values that occur in matches for eventType.
|
java.util.Set<java.lang.String> |
getAllValuesOfeventType(Transition pTransition)
Retrieve the set of values that occur in matches for eventType.
|
java.util.Set<java.lang.String> |
getAllValuesOfeventType(TransitionWithEventTypeMatch partialMatch)
Retrieve the set of values that occur in matches for eventType.
|
java.util.Set<Transition> |
getAllValuesOftransition()
Retrieve the set of values that occur in matches for transition.
|
java.util.Set<Transition> |
getAllValuesOftransition(java.lang.String pEventType)
Retrieve the set of values that occur in matches for transition.
|
java.util.Set<Transition> |
getAllValuesOftransition(TransitionWithEventTypeMatch partialMatch)
Retrieve the set of values that occur in matches for transition.
|
TransitionWithEventTypeMatch |
getOneArbitraryMatch(Transition pTransition,
java.lang.String pEventType)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(Transition pTransition,
java.lang.String pEventType)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
TransitionWithEventTypeMatch |
newMatch(Transition pTransition,
java.lang.String pEventType)
Returns a new (partial) match.
|
static TransitionWithEventTypeMatcher |
on(ViatraQueryEngine engine)
Initializes the pattern matcher within an existing VIATRA Query engine.
|
static IQuerySpecification<TransitionWithEventTypeMatcher> |
querySpecification() |
protected java.util.Set<java.lang.String> |
rawAccumulateAllValuesOfeventType(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for eventType.
|
protected java.util.Set<Transition> |
rawAccumulateAllValuesOftransition(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for transition.
|
protected TransitionWithEventTypeMatch |
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, setBackend
public static TransitionWithEventTypeMatcher 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 TransitionWithEventTypeMatcher create() throws ViatraQueryException
ViatraQueryException
- if an error occurs during pattern matcher creationpublic java.util.Collection<TransitionWithEventTypeMatch> getAllMatches(Transition pTransition, java.lang.String pEventType)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.public TransitionWithEventTypeMatch getOneArbitraryMatch(Transition pTransition, java.lang.String pEventType)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.public boolean hasMatch(Transition pTransition, java.lang.String pEventType)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.public int countMatches(Transition pTransition, java.lang.String pEventType)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.public void forEachMatch(Transition pTransition, java.lang.String pEventType, IMatchProcessor<? super TransitionWithEventTypeMatch> processor)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(Transition pTransition, java.lang.String pEventType, IMatchProcessor<? super TransitionWithEventTypeMatch> processor)
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.processor
- the action that will process the selected match.public TransitionWithEventTypeMatch newMatch(Transition pTransition, java.lang.String pEventType)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch()
to obtain a mutable match object.
pTransition
- the fixed value of pattern parameter transition, or null if not bound.pEventType
- the fixed value of pattern parameter eventType, or null if not bound.protected java.util.Set<Transition> rawAccumulateAllValuesOftransition(java.lang.Object[] parameters)
public java.util.Set<Transition> getAllValuesOftransition()
public java.util.Set<Transition> getAllValuesOftransition(TransitionWithEventTypeMatch partialMatch)
public java.util.Set<Transition> getAllValuesOftransition(java.lang.String pEventType)
protected java.util.Set<java.lang.String> rawAccumulateAllValuesOfeventType(java.lang.Object[] parameters)
public java.util.Set<java.lang.String> getAllValuesOfeventType()
public java.util.Set<java.lang.String> getAllValuesOfeventType(TransitionWithEventTypeMatch partialMatch)
public java.util.Set<java.lang.String> getAllValuesOfeventType(Transition pTransition)
protected TransitionWithEventTypeMatch tupleToMatch(Tuple t)
tupleToMatch
in class BaseMatcher<TransitionWithEventTypeMatch>
protected TransitionWithEventTypeMatch arrayToMatch(java.lang.Object[] match)
BaseMatcher
arrayToMatch
in class BaseMatcher<TransitionWithEventTypeMatch>
protected TransitionWithEventTypeMatch arrayToMatchMutable(java.lang.Object[] match)
BaseMatcher
arrayToMatchMutable
in class BaseMatcher<TransitionWithEventTypeMatch>
public static IQuerySpecification<TransitionWithEventTypeMatcher> querySpecification() throws ViatraQueryException
ViatraQueryException
- if the pattern definition could not be loaded