|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uk.org.ogsadai.activity.files.regexp.AbstractMatcher
|
+--uk.org.ogsadai.activity.files.regexp.OroMatcher
This class implements a matcher class designed around the Jakarta ORO regular
expression support. It wraps the
org.apache.oro.text.regex.PatternMatcher class
to present an interface consistent with AbstractMatcher.
An instance of this class is typically obtained using the
matcher() method on an instance of either the
OroAwkPattern or the OroPerl5Pattern class.
OroAwkPattern.matcher(),
OroPerl5Pattern.matcher()| Field Summary |
| Fields inherited from class uk.org.ogsadai.activity.files.regexp.AbstractMatcher |
mSearchOffset |
| Constructor Summary | |
OroMatcher(org.apache.oro.text.regex.Pattern pattern)
Construct a new matcher object intended to find matches of the given regular expression. |
|
| Method Summary | |
int |
endOffset()
Return the offset of the end of the most recent match of the regular expression found in the input text. |
boolean |
findNextMatch()
Search the input string for the next occurrence of a match of the regular expression. |
java.lang.String |
group(int index)
Returns the input subsequence captured by the given group during the previous match operation. |
int |
groupCount()
Returns the number of capturing groups in this matcher's regular expression. |
void |
setInput(java.lang.String input)
Register a string of text as the text over which this matcher object searches for occurrences of its regular expression. |
int |
startOffset()
Return the offset of the start of the most recent match of the regular expression found in the input text. |
| Methods inherited from class uk.org.ogsadai.activity.files.regexp.AbstractMatcher |
getSearchOffset, groups, setSearchOffset |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OroMatcher(org.apache.oro.text.regex.Pattern pattern)
throws RegexpException
pattern - the regular expression to find matches of
RegexpException - if the pattern is not of a type supported by Jakarta ORO| Method Detail |
public void setInput(java.lang.String input)
AbstractMatcherfindNextMatch() method.
setInput in class AbstractMatcherinput - the string of text to search within
public boolean findNextMatch()
throws RegexpException
AbstractMatchertrue and causes the details regarding the match to be stored
locally. These details include the offset in the entire input string
of the start and the end positions of the match; and the actual text
which matched the parenthesised groups in the regular expression
this matcher matches.
findNextMatch in class AbstractMatchertrue if another occurrence of a match of the regular
expression exists;false otherwise
RegexpException - if no text input has yet been registered via the setInput(String) methodpublic int startOffset()
AbstractMatcher
startOffset in class AbstractMatcherpublic int endOffset()
AbstractMatcher
endOffset in class AbstractMatcherpublic int groupCount()
AbstractMatcher
groupCount in class AbstractMatcherpublic java.lang.String group(int index)
AbstractMatchernull is
returned.
group in class AbstractMatcherindex - the index of the capturing group, or zero
null
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||