public class BasicSequenceMatchResult<T> extends java.lang.Object implements SequenceMatchResult<T>
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicSequenceMatchResult.MatchedGroup |
SequenceMatchResult.GroupToIntervalFunc<MR extends java.util.regex.MatchResult>, SequenceMatchResult.MatchedGroupInfo<T>
DEFAULT_COMPARATOR, GROUP_AFTER_MATCH, GROUP_BEFORE_MATCH, LENGTH_COMPARATOR, OFFSET_COMPARATOR, ORDER_COMPARATOR, PRIORITY_COMPARATOR, PRIORITY_SCORE_LENGTH_ORDER_OFFSET_COMPARATOR, SCORE_COMPARATOR, SCORER, TO_INTERVAL
CONTAINS_FIRST_ENDPOINTS_COMPARATOR, ENDPOINTS_COMPARATOR, LENGTH_ENDPOINTS_COMPARATOR, LENGTH_GT_COMPARATOR, LENGTH_LT_COMPARATOR, NESTED_FIRST_ENDPOINTS_COMPARATOR
Constructor and Description |
---|
BasicSequenceMatchResult() |
Modifier and Type | Method and Description |
---|---|
BasicSequenceMatchResult<T> |
copy() |
java.util.List<? extends T> |
elements()
Returns the original sequence the match was performed on.
|
int |
end() |
int |
end(int group) |
int |
end(java.lang.String var)
Returns the index of the next element after the subsequence captured by the given group
during this match.
|
Interval<java.lang.Integer> |
getInterval()
Returns the interval
|
int |
getOrder() |
java.lang.String |
group() |
java.lang.String |
group(int group) |
java.lang.String |
group(java.lang.String var)
Returns the
String representing the matched group. |
int |
groupCount() |
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo() |
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo(int group) |
SequenceMatchResult.MatchedGroupInfo<T> |
groupInfo(java.lang.String var) |
java.lang.Object |
groupMatchResult(int group,
int index)
Returns an Object representing the result for the match for a particular node in a group.
|
java.lang.Object |
groupMatchResult(java.lang.String var,
int index)
Returns an Object representing the result for the match for a particular node in a group.
|
java.util.List<java.lang.Object> |
groupMatchResults()
Returns a list of Objects representing the match results for the entire sequence.
|
java.util.List<java.lang.Object> |
groupMatchResults(int group)
Returns a list of Objects representing the match results for the nodes in the group.
|
java.util.List<java.lang.Object> |
groupMatchResults(java.lang.String var)
Returns a list of Objects representing the match results for the nodes in the group.
|
java.util.List<T> |
groupNodes()
Returns the entire matched subsequence as a list.
|
java.util.List<T> |
groupNodes(int group)
Returns the matched group as a list.
|
java.util.List<? extends T> |
groupNodes(java.lang.String var)
Returns the matched group as a list.
|
java.lang.Object |
groupValue()
Returns the value (some Object) associated with the entire matched sequence.
|
java.lang.Object |
groupValue(int group)
Returns the value (some Object) associated with the captured group.
|
java.lang.Object |
groupValue(java.lang.String var)
Returns the value (some Object) associated with the captured group.
|
java.lang.Object |
nodeMatchResult(int index)
Returns an Object representing the result for the match for a particular node.
|
SequencePattern<T> |
pattern()
Returns pattern used to create this sequence match result
|
double |
priority() |
double |
score() |
void |
setOrder(int order) |
int |
start() |
int |
start(int group) |
int |
start(java.lang.String var)
Returns the start index of the subsequence captured by the given group
during this match.
|
BasicSequenceMatchResult<T> |
toBasicSequenceMatchResult() |
public java.util.List<? extends T> elements()
SequenceMatchResult
elements
in interface SequenceMatchResult<T>
public SequencePattern<T> pattern()
SequenceMatchResult
pattern
in interface SequenceMatchResult<T>
public BasicSequenceMatchResult<T> toBasicSequenceMatchResult()
toBasicSequenceMatchResult
in interface SequenceMatchResult<T>
public BasicSequenceMatchResult<T> copy()
public Interval<java.lang.Integer> getInterval()
HasInterval
getInterval
in interface HasInterval<java.lang.Integer>
public int getOrder()
getOrder
in interface SequenceMatchResult<T>
public void setOrder(int order)
public double priority()
priority
in interface SequenceMatchResult<T>
public double score()
score
in interface SequenceMatchResult<T>
public int start()
start
in interface java.util.regex.MatchResult
public int start(int group)
start
in interface java.util.regex.MatchResult
public int start(java.lang.String var)
SequenceMatchResult
start
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's pattern-1
if the match was successful but the group
itself did not match anything
or if there is no capturing group in the pattern
with the given namepublic int end()
end
in interface java.util.regex.MatchResult
public int end(int group)
end
in interface java.util.regex.MatchResult
public int end(java.lang.String var)
SequenceMatchResult
end
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's pattern-1
if the match was successful but the group
itself did not match anything
or if there is no capturing group in the pattern
with the given namepublic java.lang.String group()
group
in interface java.util.regex.MatchResult
public java.lang.String group(int group)
group
in interface java.util.regex.MatchResult
public java.lang.String group(java.lang.String var)
SequenceMatchResult
String
representing the matched group.group
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternString
or null
if there is no capturing group in the pattern
with the given namepublic java.util.List<T> groupNodes()
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
public java.util.List<T> groupNodes(int group)
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic java.util.List<? extends T> groupNodes(java.lang.String var)
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternnull
if there is no capturing group in the pattern
with the given namepublic java.lang.Object groupValue()
SequenceMatchResult
groupValue
in interface SequenceMatchResult<T>
public java.lang.Object groupValue(int group)
SequenceMatchResult
groupValue
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic java.lang.Object groupValue(java.lang.String var)
SequenceMatchResult
groupValue
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic SequenceMatchResult.MatchedGroupInfo<T> groupInfo()
groupInfo
in interface SequenceMatchResult<T>
public SequenceMatchResult.MatchedGroupInfo<T> groupInfo(int group)
groupInfo
in interface SequenceMatchResult<T>
public SequenceMatchResult.MatchedGroupInfo<T> groupInfo(java.lang.String var)
groupInfo
in interface SequenceMatchResult<T>
public int groupCount()
groupCount
in interface java.util.regex.MatchResult
public java.util.List<java.lang.Object> groupMatchResults()
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
public java.util.List<java.lang.Object> groupMatchResults(int group)
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic java.util.List<java.lang.Object> groupMatchResults(java.lang.String var)
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic java.lang.Object nodeMatchResult(int index)
SequenceMatchResult
Map<Class, Object>
, while
for String, the match result is typically a MatchResult.nodeMatchResult
in interface SequenceMatchResult<T>
index
- The index of the element in the original sequence.public java.lang.Object groupMatchResult(int group, int index)
SequenceMatchResult
Map<Class, Object>
, while
for String, the match result is typically a MatchResult.groupMatchResult
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternindex
- The index of the element in the captured subsequence.public java.lang.Object groupMatchResult(java.lang.String var, int index)
SequenceMatchResult
Map<Class, Object>
, while
for String, the match result is typically a MatchResult.groupMatchResult
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternindex
- The index of the element in the captured subsequence.