E - public abstract class Match<E> extends 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 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(Collection<Match.Group<E>> pairs) |
abstract int |
endIndex() |
Match.Group<E> |
group(String name)
Retrieve a group by name.
|
abstract List<Match.Group<E>> |
groups() |
boolean |
isEmpty()
True iff this match contains no pairs.
|
int |
length() |
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 List<E> |
tokens() |
String |
toMultilineString() |
String |
toString() |
protected List<Match.Group<E>> pairs
public boolean add(Match.Group<E> pair)
public boolean addAll(Collection<Match.Group<E>> pairs)
public boolean add(Expression<E> expr, E token, int pos)
expr - token - pos - public boolean isEmpty()
public String toMultilineString()
public abstract int startIndex()
public abstract int endIndex()
public List<Match.Group<E>> pairs()
public abstract List<Match.Group<E>> groups()
public int length()
public Match.Group<E> group(String name)
name - the name of the group to retrieve.Copyright © 2010–2013 University of Washington CSE. All rights reserved.