public class BasicSequenceMatchResult<T> extends Object implements SequenceMatchResult<T>
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicSequenceMatchResult.MatchedGroup |
SequenceMatchResult.GroupToIntervalFunc<MR extends 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, NESTED_FIRST_ENDPOINTS_COMPARATOR
Constructor and Description |
---|
BasicSequenceMatchResult() |
Modifier and Type | Method and Description |
---|---|
BasicSequenceMatchResult<T> |
copy() |
List<? extends T> |
elements()
Returns the original sequence the match was performed on.
|
int |
end() |
int |
end(int group) |
int |
end(String var)
Returns the index of the next element after the subsequence captured by the given group
during this match.
|
Interval<Integer> |
getInterval()
Returns the interval
|
int |
getOrder() |
String |
group() |
String |
group(int group) |
String |
group(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(String var) |
Object |
groupMatchResult(int group,
int index)
Returns an Object representing the result for the match for a particular node in a group.
|
Object |
groupMatchResult(String var,
int index)
Returns an Object representing the result for the match for a particular node in a group.
|
List<Object> |
groupMatchResults()
Returns a list of Objects representing the match results for the entire sequence.
|
List<Object> |
groupMatchResults(int group)
Returns a list of Objects representing the match results for the nodes in the group.
|
List<Object> |
groupMatchResults(String var)
Returns a list of Objects representing the match results for the nodes in the group.
|
List<T> |
groupNodes()
Returns the entire matched subsequence as a list.
|
List<T> |
groupNodes(int group)
Returns the matched group as a list.
|
List<? extends T> |
groupNodes(String var)
Returns the matched group as a list.
|
Object |
groupValue()
Returns the value (some Object) associated with the entire matched sequence.
|
Object |
groupValue(int group)
Returns the value (some Object) associated with the captured group.
|
Object |
groupValue(String var)
Returns the value (some Object) associated with the captured group.
|
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(String var)
Returns the start index of the subsequence captured by the given group
during this match.
|
BasicSequenceMatchResult<T> |
toBasicSequenceMatchResult() |
public 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<Integer> getInterval()
HasInterval
getInterval
in interface HasInterval<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 MatchResult
public int start(int group)
start
in interface MatchResult
public int start(String var)
SequenceMatchResult
start
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic int end()
end
in interface MatchResult
public int end(int group)
end
in interface MatchResult
public int end(String var)
SequenceMatchResult
end
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic String group()
group
in interface MatchResult
public String group(int group)
group
in interface MatchResult
public String group(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 List<T> groupNodes()
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
public List<T> groupNodes(int group)
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic List<? extends T> groupNodes(String var)
SequenceMatchResult
groupNodes
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic Object groupValue()
SequenceMatchResult
groupValue
in interface SequenceMatchResult<T>
public Object groupValue(int group)
SequenceMatchResult
groupValue
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic Object groupValue(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(String var)
groupInfo
in interface SequenceMatchResult<T>
public int groupCount()
groupCount
in interface MatchResult
public List<Object> groupMatchResults()
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
public List<Object> groupMatchResults(int group)
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
group
- The index of a capturing group in this matcher's patternpublic List<Object> groupMatchResults(String var)
SequenceMatchResult
groupMatchResults
in interface SequenceMatchResult<T>
var
- The name of the capturing group in this matcher's patternpublic Object nodeMatchResult(int index)
SequenceMatchResult
nodeMatchResult
in interface SequenceMatchResult<T>
index
- The index of the element in the original sequence.public Object groupMatchResult(int group, int index)
SequenceMatchResult
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 Object groupMatchResult(String var, int index)
SequenceMatchResult
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.