Match
- the IPatternMatch type representing a single match of this pattern.public interface IncQueryMatcher<Match extends IPatternMatch>
Modifier and Type | Method and Description |
---|---|
int |
countMatches()
Returns the number of all pattern matches.
|
int |
countMatches(Match partialMatch)
Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
|
void |
forEachMatch(IMatchProcessor<? super Match> processor)
Executes the given processor on each match of the pattern.
|
void |
forEachMatch(Match partialMatch,
IMatchProcessor<? super Match> processor)
Executes the given processor on each match of the pattern that conforms to the given fixed values of some
parameters.
|
boolean |
forOneArbitraryMatch(IMatchProcessor<? super Match> processor)
Executes the given processor on an arbitrarily chosen match of the pattern.
|
boolean |
forOneArbitraryMatch(Match partialMatch,
IMatchProcessor<? super Match> 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<Match> |
getAllMatches()
Returns the set of all pattern matches.
|
java.util.Collection<Match> |
getAllMatches(Match partialMatch)
Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
|
java.util.Set<java.lang.Object> |
getAllValues(java.lang.String parameterName)
Retrieve the set of values that occur in matches for the given parameterName.
|
java.util.Set<java.lang.Object> |
getAllValues(java.lang.String parameterName,
Match partialMatch)
Retrieve the set of values that occur in matches for the given parameterName, that conforms to the given fixed
values of some parameters.
|
IncQueryEngine |
getEngine()
Returns the engine that the matcher uses.
|
Match |
getOneArbitraryMatch()
Returns an arbitrarily chosen pattern match.
|
Match |
getOneArbitraryMatch(Match partialMatch)
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
|
java.util.List<java.lang.String> |
getParameterNames()
Returns the array of symbolic parameter names.
|
java.lang.String |
getPatternName()
Fully qualified name of the pattern.
|
java.lang.Integer |
getPositionOfParameter(java.lang.String parameterName)
Returns the index of the symbolic parameter with the given name.
|
IQuerySpecification<? extends IncQueryMatcher<Match>> |
getSpecification()
The pattern that will be matched.
|
boolean |
hasMatch(Match partialMatch)
Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, under
any possible substitution of the unspecified parameters (if any).
|
Match |
newEmptyMatch()
Returns an empty, mutable Match for the matcher.
|
Match |
newMatch(java.lang.Object... parameters)
Returns a new (partial) Match object for the matcher.
|
IQuerySpecification<? extends IncQueryMatcher<Match>> getSpecification()
java.lang.String getPatternName()
java.lang.Integer getPositionOfParameter(java.lang.String parameterName)
java.util.List<java.lang.String> getParameterNames()
java.util.Collection<Match> getAllMatches()
java.util.Collection<Match> getAllMatches(Match partialMatch)
partialMatch
- a partial match of the pattern where each non-null field binds the corresponding pattern parameter to
a fixed value.Match getOneArbitraryMatch()
Match getOneArbitraryMatch(Match partialMatch)
partialMatch
- a partial match of the pattern where each non-null field binds the corresponding pattern parameter to
a fixed value.boolean hasMatch(Match partialMatch)
partialMatch
- a (partial) match of the pattern where each non-null field binds the corresponding pattern parameter
to a fixed value.int countMatches()
int countMatches(Match partialMatch)
partialMatch
- a partial match of the pattern where each non-null field binds the corresponding pattern parameter to
a fixed value.void forEachMatch(IMatchProcessor<? super Match> processor)
processor
- the action that will process each pattern match.void forEachMatch(Match partialMatch, IMatchProcessor<? super Match> processor)
partialMatch
- array where each non-null element binds the corresponding pattern parameter to a fixed value.processor
- the action that will process each pattern match.boolean forOneArbitraryMatch(IMatchProcessor<? super Match> processor)
processor
- the action that will process the selected match.boolean forOneArbitraryMatch(Match partialMatch, IMatchProcessor<? super Match> processor)
partialMatch
- array where each non-null element binds the corresponding pattern parameter to a fixed value.processor
- the action that will process the selected match.Match newEmptyMatch()
Match newMatch(java.lang.Object... parameters)
The returned match will be immutable. Use newEmptyMatch()
to obtain a mutable match object.
parameters
- the fixed value of pattern parameters, or null if not bound.java.util.Set<java.lang.Object> getAllValues(java.lang.String parameterName)
parameterName
- name of the parameter for which values are returnedjava.util.Set<java.lang.Object> getAllValues(java.lang.String parameterName, Match partialMatch)
parameterName
- name of the parameter for which values are returnedpartialMatch
- a partial match of the pattern where each non-null field binds the corresponding pattern parameter to
a fixed value.IncQueryEngine getEngine()