public class AutomatonMatcher
extends java.lang.Object
implements java.util.regex.MatchResult
RunAutomaton.newMatcher(java.lang.CharSequence)
,
RunAutomaton.newMatcher(java.lang.CharSequence, int, int)
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
group()
Returns the subsequence of the input found by the previous match.
|
java.lang.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.
|
java.util.regex.MatchResult |
toMatchResult()
Returns the current state of this
AutomatonMatcher as a
MatchResult . |
public int end() throws java.lang.IllegalStateException
end
in interface java.util.regex.MatchResult
java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public int end(int group) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalStateException
end
in interface java.util.regex.MatchResult
group
- the desired capturing group.java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.java.lang.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 java.lang.String group() throws java.lang.IllegalStateException
group
in interface java.util.regex.MatchResult
java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public java.lang.String group(int group) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalStateException
group
in interface java.util.regex.MatchResult
group
- the desired capturing group.null
if the given group did match.java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.java.lang.IndexOutOfBoundsException
- if the specified capturing group does
not exist in the underlying automaton.public int groupCount()
groupCount
in interface java.util.regex.MatchResult
public int start() throws java.lang.IllegalStateException
start
in interface java.util.regex.MatchResult
java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.public int start(int group) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalStateException
start
in interface java.util.regex.MatchResult
group
- the desired capturing group.java.lang.IllegalStateException
- if there has not been a match attempt or
if the last attempt yielded no results.java.lang.IndexOutOfBoundsException
- if the specified capturing group does
not exist in the underlying automaton.public java.util.regex.MatchResult toMatchResult()
AutomatonMatcher
as a
MatchResult
.
The result is unaffected by subsequent operations on this object.MatchResult
with the state of this
AutomatonMatcher
.Copyright © 2001-2011 Anders Møller.