Class GenericPatternMatcher
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper
-
- org.eclipse.viatra.query.runtime.api.impl.BaseMatcher<GenericPatternMatch>
-
- org.eclipse.viatra.query.runtime.api.GenericPatternMatcher
-
- All Implemented Interfaces:
ViatraQueryMatcher<GenericPatternMatch>
public class GenericPatternMatcher extends BaseMatcher<GenericPatternMatch>
This is a generic pattern matcher for any VIATRA pattern, with "interpretative" query execution. To use the pattern matcher on a given model, obtain aGenericQuerySpecificationfirst, then invoke e.g.BaseQuerySpecification.getMatcher(ViatraQueryEngine). in conjunction withViatraQueryEngine.on(org.eclipse.viatra.query.runtime.api.scope.QueryScope).Whenever available, consider using the pattern-specific generated matcher API instead.
Matches of the pattern will be represented as
GenericPatternMatch.- Since:
- 0.9
- See Also:
GenericPatternMatch,GenericMatchProcessor,GenericQuerySpecification
-
-
Field Summary
-
Fields inherited from class org.eclipse.viatra.query.runtime.api.impl.BaseMatcher
engine, querySpecification
-
-
Constructor Summary
Constructors Constructor Description GenericPatternMatcher(GenericQuerySpecification<? extends GenericPatternMatcher> specification)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericPatternMatcharrayToMatch(java.lang.Object[] parameters)Converts the array representation of a pattern match to an immutable Match object.GenericPatternMatcharrayToMatchMutable(java.lang.Object[] parameters)Converts the array representation of a pattern match to a mutable Match object.GenericQuerySpecification<? extends GenericPatternMatcher>getSpecification()The pattern that will be matched.protected GenericPatternMatchtupleToMatch(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, hasMatch, hasMatch, matchToArray, newEmptyMatch, newMatch, rawAccumulateAllValues, rawCountMatches, rawForEachMatch, rawForOneArbitraryMatch, rawGetOneArbitraryMatch, rawHasMatch, rawStreamAllMatches, rawStreamAllValues, setBackend, streamAllMatches, streamAllMatches
-
-
-
-
Constructor Detail
-
GenericPatternMatcher
public GenericPatternMatcher(GenericQuerySpecification<? extends GenericPatternMatcher> specification)
- Since:
- 1.4
-
-
Method Detail
-
arrayToMatch
public GenericPatternMatch arrayToMatch(java.lang.Object[] parameters)
Description copied from class:BaseMatcherConverts the array representation of a pattern match to an immutable Match object.- Specified by:
arrayToMatchin classBaseMatcher<GenericPatternMatch>
-
arrayToMatchMutable
public GenericPatternMatch arrayToMatchMutable(java.lang.Object[] parameters)
Description copied from class:BaseMatcherConverts the array representation of a pattern match to a mutable Match object.- Specified by:
arrayToMatchMutablein classBaseMatcher<GenericPatternMatch>
-
tupleToMatch
protected GenericPatternMatch tupleToMatch(Tuple t)
- Specified by:
tupleToMatchin classBaseMatcher<GenericPatternMatch>
-
getSpecification
public GenericQuerySpecification<? extends GenericPatternMatcher> getSpecification()
Description copied from interface:ViatraQueryMatcherThe pattern that will be matched.- Specified by:
getSpecificationin interfaceViatraQueryMatcher<GenericPatternMatch>- Overrides:
getSpecificationin classBaseMatcher<GenericPatternMatch>
-
-