Class Match.Group<E>
- java.lang.Object
-
- edu.washington.cs.knowitall.regex.Match.Group<E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Match.Group.Token<E>
-
Field Summary
Fields Modifier and Type Field Description Expression<E>
expr
private java.util.List<Match.Group.Token<E>>
tokens
-
Constructor Summary
Constructors Constructor Description Group(Expression<E> expr)
Group(Expression<E> expr, E token, int pos)
Group(Expression<E> expr, java.util.List<Match.Group.Token<E>> tokens)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addTokens(Match.Group<E> group)
Add tokens to the group.int
endIndex()
int
startIndex()
java.lang.String
text()
A string representation of the group.int
tokenCount()
java.util.List<E>
tokens()
java.lang.String
toString()
-
-
-
Field Detail
-
expr
public final Expression<E> expr
-
tokens
private final java.util.List<Match.Group.Token<E>> tokens
-
-
Constructor Detail
-
Group
public Group(Expression<E> expr, E token, int pos)
-
Group
public Group(Expression<E> expr, java.util.List<Match.Group.Token<E>> tokens)
-
Group
public Group(Expression<E> expr)
-
-
Method Detail
-
addTokens
protected void addTokens(Match.Group<E> group)
Add tokens to the group.- Parameters:
group
-
-
tokens
public java.util.List<E> 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
public java.lang.String 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-