public class Param2containmentMatcher extends BaseMatcher<Param2containmentMatch>
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 Param2containmentMatch
.
Original source:
@QueryExplorer(checked = false)
pattern param2containment(source, target, trace, containment : Containment) {
Trace.params(trace, source);
Trace.params(trace, target);
Trace.targets(trace, containment);
} or {
Trace.objects(trace, source);
Trace.params(trace, target);
Trace.targets(trace, containment);
} or {
Trace.params(trace, source);
Trace.objects(trace, target);
Trace.targets(trace, containment);
} or {
Trace.objects(trace, source);
Trace.objects(trace, target);
Trace.targets(trace, containment);
}
Param2containmentMatch
,
Param2containmentProcessor
,
Param2containmentQuerySpecification
engine, querySpecification
Modifier and Type | Method and Description |
---|---|
protected Param2containmentMatch |
arrayToMatch(java.lang.Object[] match)
Converts the array representation of a pattern match to an immutable Match object.
|
protected Param2containmentMatch |
arrayToMatchMutable(java.lang.Object[] match)
Converts the array representation of a pattern match to a mutable Match object.
|
int |
countMatches(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
static Param2containmentMatcher |
create() |
void |
forEachMatch(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment,
IMatchProcessor<? super Param2containmentMatch> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
forOneArbitraryMatch(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment,
IMatchProcessor<? super Param2containmentMatch> 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<Param2containmentMatch> |
getAllMatches(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<Containment> |
getAllValuesOfcontainment()
Retrieve the set of values that occur in matches for containment.
|
java.util.Set<Containment> |
getAllValuesOfcontainment(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace)
Retrieve the set of values that occur in matches for containment.
|
java.util.Set<Containment> |
getAllValuesOfcontainment(Param2containmentMatch partialMatch)
Retrieve the set of values that occur in matches for containment.
|
java.util.Set<java.lang.Object> |
getAllValuesOfsource()
Retrieve the set of values that occur in matches for source.
|
java.util.Set<java.lang.Object> |
getAllValuesOfsource(java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Retrieve the set of values that occur in matches for source.
|
java.util.Set<java.lang.Object> |
getAllValuesOfsource(Param2containmentMatch partialMatch)
Retrieve the set of values that occur in matches for source.
|
java.util.Set<java.lang.Object> |
getAllValuesOftarget()
Retrieve the set of values that occur in matches for target.
|
java.util.Set<java.lang.Object> |
getAllValuesOftarget(java.lang.Object pSource,
Trace pTrace,
Containment pContainment)
Retrieve the set of values that occur in matches for target.
|
java.util.Set<java.lang.Object> |
getAllValuesOftarget(Param2containmentMatch partialMatch)
Retrieve the set of values that occur in matches for target.
|
java.util.Set<Trace> |
getAllValuesOftrace()
Retrieve the set of values that occur in matches for trace.
|
java.util.Set<Trace> |
getAllValuesOftrace(java.lang.Object pSource,
java.lang.Object pTarget,
Containment pContainment)
Retrieve the set of values that occur in matches for trace.
|
java.util.Set<Trace> |
getAllValuesOftrace(Param2containmentMatch partialMatch)
Retrieve the set of values that occur in matches for trace.
|
Param2containmentMatch |
getOneArbitraryMatch(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
boolean |
hasMatch(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
under any possible substitution of the unspecified parameters (if any).
|
Param2containmentMatch |
newMatch(java.lang.Object pSource,
java.lang.Object pTarget,
Trace pTrace,
Containment pContainment)
Returns a new (partial) match.
|
static Param2containmentMatcher |
on(ViatraQueryEngine engine)
Initializes the pattern matcher within an existing VIATRA Query engine.
|
static IQuerySpecification<Param2containmentMatcher> |
querySpecification() |
protected java.util.Set<Containment> |
rawAccumulateAllValuesOfcontainment(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for containment.
|
protected java.util.Set<java.lang.Object> |
rawAccumulateAllValuesOfsource(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for source.
|
protected java.util.Set<java.lang.Object> |
rawAccumulateAllValuesOftarget(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for target.
|
protected java.util.Set<Trace> |
rawAccumulateAllValuesOftrace(java.lang.Object[] parameters)
Retrieve the set of values that occur in matches for trace.
|
protected Param2containmentMatch |
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 Param2containmentMatcher 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 Param2containmentMatcher create() throws ViatraQueryException
ViatraQueryException
- if an error occurs during pattern matcher creationpublic java.util.Collection<Param2containmentMatch> getAllMatches(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.public Param2containmentMatch getOneArbitraryMatch(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.public boolean hasMatch(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.public int countMatches(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.public void forEachMatch(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment, IMatchProcessor<? super Param2containmentMatch> processor)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.processor
- the action that will process each pattern match.public boolean forOneArbitraryMatch(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment, IMatchProcessor<? super Param2containmentMatch> processor)
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.processor
- the action that will process the selected match.public Param2containmentMatch newMatch(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace, Containment pContainment)
The returned match will be immutable. Use BaseMatcher.newEmptyMatch()
to obtain a mutable match object.
pSource
- the fixed value of pattern parameter source, or null if not bound.pTarget
- the fixed value of pattern parameter target, or null if not bound.pTrace
- the fixed value of pattern parameter trace, or null if not bound.pContainment
- the fixed value of pattern parameter containment, or null if not bound.protected java.util.Set<java.lang.Object> rawAccumulateAllValuesOfsource(java.lang.Object[] parameters)
public java.util.Set<java.lang.Object> getAllValuesOfsource()
public java.util.Set<java.lang.Object> getAllValuesOfsource(Param2containmentMatch partialMatch)
public java.util.Set<java.lang.Object> getAllValuesOfsource(java.lang.Object pTarget, Trace pTrace, Containment pContainment)
protected java.util.Set<java.lang.Object> rawAccumulateAllValuesOftarget(java.lang.Object[] parameters)
public java.util.Set<java.lang.Object> getAllValuesOftarget()
public java.util.Set<java.lang.Object> getAllValuesOftarget(Param2containmentMatch partialMatch)
public java.util.Set<java.lang.Object> getAllValuesOftarget(java.lang.Object pSource, Trace pTrace, Containment pContainment)
protected java.util.Set<Trace> rawAccumulateAllValuesOftrace(java.lang.Object[] parameters)
public java.util.Set<Trace> getAllValuesOftrace()
public java.util.Set<Trace> getAllValuesOftrace(Param2containmentMatch partialMatch)
public java.util.Set<Trace> getAllValuesOftrace(java.lang.Object pSource, java.lang.Object pTarget, Containment pContainment)
protected java.util.Set<Containment> rawAccumulateAllValuesOfcontainment(java.lang.Object[] parameters)
public java.util.Set<Containment> getAllValuesOfcontainment()
public java.util.Set<Containment> getAllValuesOfcontainment(Param2containmentMatch partialMatch)
public java.util.Set<Containment> getAllValuesOfcontainment(java.lang.Object pSource, java.lang.Object pTarget, Trace pTrace)
protected Param2containmentMatch tupleToMatch(Tuple t)
tupleToMatch
in class BaseMatcher<Param2containmentMatch>
protected Param2containmentMatch arrayToMatch(java.lang.Object[] match)
BaseMatcher
arrayToMatch
in class BaseMatcher<Param2containmentMatch>
protected Param2containmentMatch arrayToMatchMutable(java.lang.Object[] match)
BaseMatcher
arrayToMatchMutable
in class BaseMatcher<Param2containmentMatch>
public static IQuerySpecification<Param2containmentMatcher> querySpecification() throws ViatraQueryException
ViatraQueryException
- if the pattern definition could not be loaded