Package tools.refinery.interpreter.api
Class GenericPatternMatcher
java.lang.Object
tools.refinery.interpreter.internal.apiimpl.QueryResultWrapper
tools.refinery.interpreter.api.impl.BaseMatcher<GenericPatternMatch>
tools.refinery.interpreter.api.GenericPatternMatcher
- All Implemented Interfaces:
InterpreterMatcher<GenericPatternMatch>
This is a generic pattern matcher for any Refinery Interpreter pattern, with "interpretative" query execution.
To use the pattern matcher on a given model, obtain a
.
GenericQuerySpecification
first, then
invoke e.g. BaseQuerySpecification.getMatcher(InterpreterEngine)
.
in conjunction with
invalid reference
InterpreterEngine#on(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:
-
Field Summary
Fields inherited from class tools.refinery.interpreter.api.impl.BaseMatcher
engine, querySpecification
Fields inherited from class tools.refinery.interpreter.internal.apiimpl.QueryResultWrapper
backend
-
Constructor Summary
ConstructorsConstructorDescriptionGenericPatternMatcher
(GenericQuerySpecification<? extends GenericPatternMatcher> specification) -
Method Summary
Modifier and TypeMethodDescriptionarrayToMatch
(Object[] parameters) Converts the array representation of a pattern match to an immutable Match object.arrayToMatchMutable
(Object[] parameters) Converts the array representation of a pattern match to a mutable Match object.GenericQuerySpecification
<? extends GenericPatternMatcher> The pattern that will be matched.protected GenericPatternMatch
Methods inherited from class tools.refinery.interpreter.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 Details
-
GenericPatternMatcher
public GenericPatternMatcher(GenericQuerySpecification<? extends GenericPatternMatcher> specification) - Since:
- 1.4
-
-
Method Details
-
arrayToMatch
Description copied from class:BaseMatcher
Converts the array representation of a pattern match to an immutable Match object.- Specified by:
arrayToMatch
in classBaseMatcher<GenericPatternMatch>
-
arrayToMatchMutable
Description copied from class:BaseMatcher
Converts the array representation of a pattern match to a mutable Match object.- Specified by:
arrayToMatchMutable
in classBaseMatcher<GenericPatternMatch>
-
tupleToMatch
- Specified by:
tupleToMatch
in classBaseMatcher<GenericPatternMatch>
-
getSpecification
Description copied from interface:InterpreterMatcher
The pattern that will be matched.- Specified by:
getSpecification
in interfaceInterpreterMatcher<GenericPatternMatch>
- Overrides:
getSpecification
in classBaseMatcher<GenericPatternMatch>
-