|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.core.regexp.RegularExpressionJava14
Regular expression parser that wraps the Java 1.4 java.util.regex package.
Constructor Summary | |
RegularExpressionJava14()
|
Method Summary | |
int |
end(int group)
Retrieves the ending offset of the matched group text, relative to the start of the full matched text (i.e., group zero). |
int |
getGroupCount()
Calculates the number of groups found in the current pattern. |
java.lang.String |
group(int group)
Retrieves the fragment of the input text from the most recent call to matches() that corresponds to the given group index. |
boolean |
loadPattern(java.lang.String pattern)
Loads the regular expression pattern. |
boolean |
matches(java.lang.String text)
Determines if the text matches against the current pattern. |
int |
start(int group)
Retrieves the beginning offset of the matched group text, relative to the start of the full matched text (i.e., group zero). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RegularExpressionJava14()
Method Detail |
public boolean loadPattern(java.lang.String pattern)
loadPattern
in interface IRegularExpression
pattern
- regular expression pattern
public boolean matches(java.lang.String text)
matches
in interface IRegularExpression
text
- text to match against the current regular expression
java.lang.IllegalStateException
- if loadPattern() hasn't been called yet
on a valid patternpublic int getGroupCount()
getGroupCount
in interface IRegularExpression
java.lang.IllegalStateException
- if loadPattern() and matches() haven't
been called yet on a valid patternpublic java.lang.String group(int group)
group
in interface IRegularExpression
group
- index of parenthetical groups in the current pattern
java.lang.IllegalStateException
- if loadPattern() and matches() haven't
been called yet on a valid pattern
java.lang.IndexOutOfBoundsException
- if the index is < 0 or >=
getGroupCount()public int start(int group)
start
in interface IRegularExpression
group
- index of parenthetical groups in the current pattern
java.lang.IllegalStateException
- if loadPattern() and matches() haven't
been called yet on a valid pattern
java.lang.IndexOutOfBoundsException
- if the index is < 0 or >=
getGroupCount()public int end(int group)
end
in interface IRegularExpression
group
- index of parenthetical groups in the current pattern
java.lang.IllegalStateException
- if loadPattern() and matches() haven't
been called yet on a valid pattern
java.lang.IndexOutOfBoundsException
- if the index is < 0 or >=
getGroupCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |