|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.percederberg.grammatica.parser.re.Matcher
public class 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.
| 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. |
boolean |
isCaseInsensitive()
Checks if this matcher compares in case-insensitive mode. |
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. |
void |
reset(ReaderBuffer buffer)
Resets the matcher for use with a new look-ahead character input buffer. |
void |
reset(java.lang.String str)
Resets the matcher for use with a new input string. |
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 |
| Method Detail |
|---|
public boolean isCaseInsensitive()
public void reset()
public void reset(java.lang.String str)
str - the new string to work withpublic void reset(ReaderBuffer buffer)
buffer - the character input streampublic int start()
public int end()
public int length()
public boolean hasReadEndOfString()
public boolean matchFromBeginning()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while reading an
input stream
public boolean matchFrom(int pos)
throws java.io.IOException
pos - the starting position of the match
java.io.IOException - if an I/O error occurred while reading an
input streampublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||