E
- public abstract class Match<E>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Match.FinalMatch<E>
A match representation that has efficient method calls but is immutable.
|
static class |
Match.Group<E>
A captured group in a matched expression.
|
protected static class |
Match.IntermediateMatch<E>
A match representation that is mutable but many method calls compute
values instead of returning stored values.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Match.Group<E>> |
pairs |
Modifier | Constructor and Description |
---|---|
protected |
Match() |
protected |
Match(Match<E> match) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(Expression<E> expr,
E token,
int pos)
Convenience method for add(new Group
|
boolean |
add(Match.Group<E> pair) |
boolean |
addAll(java.util.Collection<Match.Group<E>> pairs) |
abstract int |
endIndex() |
Match.Group<E> |
group(java.lang.String name)
Retrieve a group by name.
|
abstract java.util.List<Match.Group<E>> |
groups() |
boolean |
isEmpty()
True iff this match contains no pairs.
|
int |
length() |
java.util.List<Match.Group<E>> |
pairs()
Pairs differ from the matching groups in that each regular expression
element has a pair to associate the element with the text matched.
|
abstract int |
startIndex() |
abstract java.util.List<E> |
tokens() |
java.lang.String |
toMultilineString() |
java.lang.String |
toString() |
protected java.util.List<Match.Group<E>> pairs
public boolean add(Match.Group<E> pair)
public boolean addAll(java.util.Collection<Match.Group<E>> pairs)
public boolean add(Expression<E> expr, E token, int pos)
expr
- token
- pos
- public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toMultilineString()
public abstract int startIndex()
public abstract int endIndex()
public java.util.List<Match.Group<E>> pairs()
public abstract java.util.List<Match.Group<E>> groups()
public abstract java.util.List<E> tokens()
public int length()
public Match.Group<E> group(java.lang.String name)
name
- the name of the group to retrieve.