|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.automaton.AutomatonMatcher
public class AutomatonMatcher
A tool that performs match operations on a given character sequence using a compiled automaton.
RunAutomaton.newMatcher(java.lang.CharSequence)
,
RunAutomaton.newMatcher(java.lang.CharSequence, int, int)
Method Summary | |
---|---|
int |
end()
Returns the offset after the last character matched. |
int |
end(int group)
Returns the offset after the last character matched of the specified capturing group. |
boolean |
find()
Find the next matching subsequence of the input. |
String |
group()
Returns the subsequence of the input found by the previous match. |
String |
group(int group)
Returns the subsequence of the input found by the specified capturing group during the previous match operation. |
int |
groupCount()
Returns the number of capturing groups in the underlying automaton. |
int |
start()
Returns the offset of the first character matched. |
int |
start(int group)
Returns the offset of the first character matched of the specified capturing group. |
MatchResult |
toMatchResult()
Returns the current state of this AutomatonMatcher as a
MatchResult . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int end() throws IllegalStateException
end
in interface MatchResult
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public int end(int group) throws IndexOutOfBoundsException, IllegalStateException
end
in interface MatchResult
group
- the desired capturing group.
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.
IndexOutOfBoundsException
- if the specified capturing group does
not exist in the underlying automaton.public boolean find()
start
, end
, and
group
methods.
true
if there is a matching subsequence.public String group() throws IllegalStateException
group
in interface MatchResult
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public String group(int group) throws IndexOutOfBoundsException, IllegalStateException
group
in interface MatchResult
group
- the desired capturing group.
null
if the given group did match.
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.
IndexOutOfBoundsException
- if the specified capturing group does
not exist in the underlying automaton.public int groupCount()
groupCount
in interface MatchResult
public int start() throws IllegalStateException
start
in interface MatchResult
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public int start(int group) throws IndexOutOfBoundsException, IllegalStateException
start
in interface MatchResult
group
- the desired capturing group.
IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.
IndexOutOfBoundsException
- if the specified capturing group does
not exist in the underlying automaton.public MatchResult toMatchResult()
AutomatonMatcher
as a
MatchResult
.
The result is unaffected by subsequent operations on this object.
MatchResult
with the state of this
AutomatonMatcher
.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |