gnu.regexp
Class CharIndexedReader
java.lang.Object
gnu.regexp.CharIndexedReader
- CharIndexed
(package private) class CharIndexedReader
extends java.lang.Object
char | charAt(int index) - Returns the character at the given offset past the current cursor
position in the input.
|
boolean | isValid() - Returns true if the most recent move() operation placed the cursor
position at a valid position in the input.
|
boolean | move(int index) - Shifts the input buffer by a given number of positions.
|
CharIndexedReader
(package private) CharIndexedReader(Reader reader,
int index)
charAt
public char charAt(int index)
Returns the character at the given offset past the current cursor
position in the input. The index of the current position is zero.
It is possible for this method to be called with a negative index.
This happens when using the '^' operator in multiline matching mode
or the '\b' or '\<' word boundary operators. In any case, the lower
bound is currently fixed at -2 (for '^' with a two-character newline).
- charAt in interface CharIndexed
index
- the offset position in the character field to examine
- the character at the specified index, or the OUT_OF_BOUNDS
character defined by this interface.
isValid
public boolean isValid()
Returns true if the most recent move() operation placed the cursor
position at a valid position in the input.
- isValid in interface CharIndexed
move
public boolean move(int index)
Shifts the input buffer by a given number of positions. Returns
true if the new cursor position is valid.
- move in interface CharIndexed