|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.oro.text.regex.PatternMatcherInput
Safe:
Field Summary | |
(package private) int |
_beginOffset
|
(package private) int |
_currentOffset
|
(package private) int |
_endOffset
|
(package private) int |
_matchBeginOffset
|
(package private) int |
_matchEndOffset
|
(package private) char[] |
_originalBuffer
|
(package private) char[] |
_originalCharInput
|
(package private) String |
_originalStringInput
|
(package private) char[] |
_toLowerBuffer
|
Constructor Summary | |
PatternMatcherInput(char[] input)
Enabled: Like calling: |
|
PatternMatcherInput(char[] input,
int begin,
int length)
Enabled: Creates a PatternMatcherInput object, associating a region of a string (represented as a char[]) as input to be used for pattern matching by PatternMatcher objects. |
|
PatternMatcherInput(String input)
Enabled: Like calling |
|
PatternMatcherInput(String input,
int begin,
int length)
Enabled: Creates a PatternMatcherInput object, associating a region of a String as input to be used for pattern matching by PatternMatcher objects. |
Method Summary | |
char |
charAt(int offset)
Enabled: Returns the character at a particular offset relative to the begin offset of the input. |
boolean |
endOfInput()
Enabled: Returns whether or not the end of the input has been reached. |
int |
getBeginOffset()
Enabled: @return The offset of the input that should be considered the start of the region to be considered as input by PatternMatcher methods. |
char[] |
getBuffer()
Enabled: Retrieves the char[] buffer to be used used as input by PatternMatcher implementations to look for matches. |
int |
getCurrentOffset()
Enabled: @return The offset of the input that should be considered the current offset where PatternMatcher methods should start looking for matches. |
int |
getEndOffset()
Enabled: @return The offset of the input that should be considered the end of the region to be considered as input by PatternMatcher methods. |
Object |
getInput()
Enabled: Retrieves the original input used to initialize the PatternMatcherInput instance. |
int |
getMatchBeginOffset()
Enabled: Returns the offset marking the beginning of the match found by contains(). |
int |
getMatchEndOffset()
Enabled: Returns the offset marking the end of the match found by contains(). |
int |
length()
Enabled: @return The length of the region to be considered input for pattern matching purposes. |
String |
match()
Enabled: A convenience method returning the part of the input corresponding to the last match found by a call to a Perl5Matcher contains method. |
String |
postMatch()
Enabled: A convenience method returning the part of the input occurring after the last match found by a call to a Perl5Matcher contains method. |
String |
preMatch()
Enabled: A convenience method returning the part of the input occurring before the last match found by a call to a Perl5Matcher contains method. |
void |
setBeginOffset(int offset)
Enabled: Sets the offset of the input that should be considered the start of the region to be considered as input by PatternMatcher methods. |
void |
setCurrentOffset(int offset)
Enabled: Sets the offset of the input that should be considered the current offset where PatternMatcher methods should start looking for matches. |
void |
setEndOffset(int offset)
Enabled: Sets the offset of the input that should be considered the end of the region to be considered as input by PatternMatcher methods. |
void |
setInput(char[] input)
Enabled: This method is identical to calling: |
void |
setInput(char[] input,
int begin,
int length)
Enabled: Associates a region of a string (represented as a char[]) as input to be used for pattern matching by PatternMatcher objects. |
void |
setInput(String input)
Enabled: This method is identical to calling: |
void |
setInput(String input,
int begin,
int length)
Enabled: Associates a region of a String as input to be used for pattern matching by PatternMatcher objects. |
void |
setMatchOffsets(int matchBeginOffset,
int matchEndOffset)
Enabled: This method is intended for use by PatternMatcher implementations. |
String |
substring(int beginOffset)
Enabled: Returns a new string that is a substring of the PatternMatcherInput instance. |
String |
substring(int beginOffset,
int endOffset)
Enabled: Returns a new string that is a substring of the PatternMatcherInput instance. |
String |
toString()
Suppressed: Returns the string representation of the input, where the input is considered to start from the begin offset and end at the end offset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
String _originalStringInput
char[] _originalCharInput
char[] _originalBuffer
char[] _toLowerBuffer
int _beginOffset
int _endOffset
int _currentOffset
int _matchBeginOffset
int _matchEndOffset
Constructor Detail |
public PatternMatcherInput(String input, int begin, int length)
input
- The input to associate with the PatternMatcherInput.begin
- The offset into the char[] to use as the beginning of
the input.length
- The length of the reegion starting from the begin offset
to use as the input for pattern matching purposes.public PatternMatcherInput(String input)
PatternMatcherInput(input, 0, input.length());
input
- The input to associate with the PatternMatcherInput.public PatternMatcherInput(char[] input, int begin, int length)
input
- The input to associate with the PatternMatcherInput.begin
- The offset into the char[] to use as the beginning of
the input.length
- The length of the reegion starting from the begin offset
to use as the input for pattern matching purposes.public PatternMatcherInput(char[] input)
PatternMatcherInput(input, 0, input.length);
input
- The input to associate with the PatternMatcherInput.Method Detail |
public int length()
public void setInput(String input, int begin, int length)
input
- The input to associate with the PatternMatcherInput.begin
- The offset into the String to use as the beginning of
the input.length
- The length of the reegion starting from the begin offset
to use as the input for pattern matching purposes.public void setInput(String input)
setInput(input, 0, input.length());
input
- The input to associate with the PatternMatcherInput.public void setInput(char[] input, int begin, int length)
input
- The input to associate with the PatternMatcherInput.begin
- The offset into the char[] to use as the beginning of
the input.length
- The length of the reegion starting from the begin offset
to use as the input for pattern matching purposes.public void setInput(char[] input)
setInput(input, 0, input.length);
input
- The input to associate with the PatternMatcherInput.public char charAt(int offset)
offset
- The offset at which to fetch a character (relative to
the beginning offset.
public String substring(int beginOffset, int endOffset)
beginOffset
- The offset relative to the begin offset of the
PatternMatcherInput at which to start the substring (inclusive).endOffset
- The offset relative to the begin offset of the
PatternMatcherInput at which to end the substring (exclusive).
public String substring(int beginOffset)
beginOffset
- The offset relative to the begin offset of the
PatternMatcherInput at which to start the substring.
public Object getInput()
public char[] getBuffer()
public boolean endOfInput()
public int getBeginOffset()
public int getEndOffset()
public int getCurrentOffset()
public void setBeginOffset(int offset)
offset
- The offset to use as the beginning of the input.public void setEndOffset(int offset)
offset
- The offset to use as the end of the input.public void setCurrentOffset(int offset)
offset
- The offset to use as the current offset.public String toString()
toString
in class Object
public String preMatch()
contains
method.
public String postMatch()
contains
method.
public String match()
contains
method.
The method is not called getMatch() so as not to confuse it
with Perl5Matcher's getMatch() which returns a MatchResult instance
and also for consistency with preMatch() and postMatch().
public void setMatchOffsets(int matchBeginOffset, int matchEndOffset)
As a note, the preMatch(), postMatch(), and match() methods are provided as conveniences because PatternMatcherInput must store match offset information to completely preserve state for consecutive PatternMatcher contains() matches.
matchBeginOffset
- The begin offset of a match found by contains().matchEndOffset
- The end offset of a match found by contains().public int getMatchBeginOffset()
public int getMatchEndOffset()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |