Package gnu.regexp
Class CharIndexedReader
java.lang.Object
gnu.regexp.CharIndexedReader
- All Implemented Interfaces:
CharIndexed
-
Field Summary
Fields inherited from interface gnu.regexp.CharIndexed
OUT_OF_BOUNDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) Returns the character at the given offset past the current cursor position in the input.booleanisValid()Returns true if the most recent move() operation placed the cursor position at a valid position in the input.booleanmove(int index) Shifts the input buffer by a given number of positions.
-
Constructor Details
-
CharIndexedReader
CharIndexedReader(Reader reader, int index)
-
-
Method Details
-
charAt
public char charAt(int index) Description copied from interface:CharIndexedReturns 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 '\invalid input: '<'' word boundary operators. In any case, the lower bound is currently fixed at -2 (for '^' with a two-character newline).- Specified by:
charAtin interfaceCharIndexed- Parameters:
index- the offset position in the character field to examine- Returns:
- the character at the specified index, or the OUT_OF_BOUNDS character defined by this interface.
-
move
public boolean move(int index) Description copied from interface:CharIndexedShifts the input buffer by a given number of positions. Returns true if the new cursor position is valid.- Specified by:
movein interfaceCharIndexed
-
isValid
public boolean isValid()Description copied from interface:CharIndexedReturns true if the most recent move() operation placed the cursor position at a valid position in the input.- Specified by:
isValidin interfaceCharIndexed
-