|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.percederberg.grammatica.parser.re.Matcher
A regular expression string matcher. This class handles the matching of a specific string with a specific regular expression. It contains state information about the matching process, as for example the position of the latest match, and a number of flags that were set. This class is not thread-safe.
Constructor Summary | |
protected |
Matcher(net.percederberg.grammatica.parser.re.Element e,
CharBuffer str)
Creates a new matcher with the specified element. |
Method Summary | |
int |
end()
Returns the end position of the latest match. |
boolean |
hasReadEndOfString()
Checks if the end of the string was encountered during the last match attempt. |
int |
length()
Returns the length of the latest match. |
boolean |
matchFrom(int pos)
Attempts to find a match starting at the specified position in the string. |
boolean |
matchFromBeginning()
Attempts to find a match starting at the beginning of the string. |
void |
reset()
Resets the information about the last match. |
int |
start()
Returns the start position of the latest match. |
java.lang.String |
toString()
Returns the latest matched string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected Matcher(net.percederberg.grammatica.parser.re.Element e, CharBuffer str)
e
- the base regular expression elementstr
- the string to work withMethod Detail |
public void reset()
public int start()
public int end()
public int length()
public boolean hasReadEndOfString()
public boolean matchFromBeginning()
public boolean matchFrom(int pos)
pos
- the starting position of the match
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |