public interface IPatternMatch
extends java.lang.Cloneable
Can also represent a partial match; unsubstituted parameters are assigned to null. Pattern matchers must never return a partial match, but they accept partial matches as method parameters.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(int position)
Returns the value of the parameter at the given position, or null if position is invalid.
|
java.lang.Object |
get(java.lang.String parameterName)
Returns the value of the parameter with the given name, or null if name is invalid.
|
boolean |
isCompatibleWith(IPatternMatch other)
Checks that this match is compatible with the given other match.
|
boolean |
isMutable()
Returns whether the match object can be further modified after its creation.
|
java.util.List<java.lang.String> |
parameterNames()
Returns the list of symbolic parameter names.
|
java.lang.String |
patternName()
Identifies the name of the pattern for which this is a match.
|
java.lang.String |
prettyPrint()
Prints the list of parameter-value pairs.
|
boolean |
set(int position,
java.lang.Object newValue)
Sets the parameter at the given position to the given value.
|
boolean |
set(java.lang.String parameterName,
java.lang.Object newValue)
Sets the parameter with the given name to the given value.
|
IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>> |
specification() |
java.lang.Object[] |
toArray()
Converts the match to an array representation, with each pattern parameter at their respective position.
|
IPatternMatch |
toImmutable()
Takes an immutable snapshot of this match.
|
IQuerySpecification<? extends IncQueryMatcher<? extends IPatternMatch>> specification()
java.lang.String patternName()
java.util.List<java.lang.String> parameterNames()
java.lang.Object get(java.lang.String parameterName)
java.lang.Object get(int position)
boolean set(java.lang.String parameterName, java.lang.Object newValue)
Works only if match is mutable. See isMutable()
.
java.lang.UnsupportedOperationException
- if match is not mutable.boolean set(int position, java.lang.Object newValue)
Works only if match is mutable. See isMutable()
.
java.lang.UnsupportedOperationException
- if match is not mutable.boolean isMutable()
Matches computed by the pattern matchers are not mutable, so that the match set cannot be modified externally.
Partial matches used as matcher input, however, can be mutable; such match objects can be created using IncQueryMatcher.newEmptyMatch()
.
java.lang.Object[] toArray()
IPatternMatch toImmutable()
java.lang.String prettyPrint()
boolean isCompatibleWith(IPatternMatch other)
other
-