|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the interface used internally so that different types of source text can be accessed in the same way. Built-in concrete classes provide support for String, StringBuffer, InputStream and char[] types. A class that is CharIndexed supports the notion of a cursor within a block of text. The cursor must be able to be advanced via the move() method. The charAt() method returns the character at the cursor position plus a given offset.
Field Summary | |
static char |
OUT_OF_BOUNDS
Defines a constant (0xFFFF was somewhat arbitrarily chosen) that can be returned by the charAt() function indicating that the specified index is out of range. |
Method Summary | |
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. |
Field Detail |
public static final char OUT_OF_BOUNDS
Method Detail |
public char charAt(int index)
index
- the offset position in the character field to examine
public boolean move(int index)
public boolean isValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |