Class Match.Group<E>
java.lang.Object
edu.washington.cs.knowitall.regex.Match.Group<E>
- Type Parameters:
E
-
A captured group in a matched expression.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGroup
(Expression<E> expr) Group
(Expression<E> expr, E token, int pos) Group
(Expression<E> expr, List<Match.Group.Token<E>> tokens) -
Method Summary
-
Field Details
-
expr
-
tokens
-
-
Constructor Details
-
Group
-
Group
-
Group
-
-
Method Details
-
addTokens
Add tokens to the group.- Parameters:
group
-
-
tokens
- Returns:
- the tokens matched.
-
startIndex
public int startIndex()- Returns:
- the index of the first token in this group or -1
-
endIndex
public int endIndex()- Returns:
- the index of the last token in this group or -1
-
text
A string representation of the group. This is a lighter-weight representation than toString. -
tokenCount
public int tokenCount()- Returns:
- the number of tokens matched.
-
toString
-