|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface InputBuffer
Abstraction of a simple char[] buffer holding the input text to be parsed.
Nested Class Summary | |
---|---|
static class |
InputBuffer.Position
Simple container class for a line/column position in the input text. |
Method Summary | |
---|---|
char |
charAt(int index)
Returns the character at the given index. |
java.lang.String |
extract(int start,
int end)
Constructs a new String from all character between the given indices. |
java.lang.String |
extractLine(int lineNumber)
Constructs a new String containing all characters with the given line number except for the trailing
newline. |
int |
getLineCount()
Returns the number of lines in the input buffer. |
InputBuffer.Position |
getPosition(int index)
Returns the line and column number of the character with the given index encapsulated in a InputBuffer.Position
object. |
boolean |
test(int index,
char[] characters)
Determines whether the characters starting at the given index match the ones from the given array (in order). |
Method Detail |
---|
char charAt(int index)
Chars.EOI
.
index
- the index
boolean test(int index, char[] characters)
index
- the index into the input buffer where to start the comparisoncharacters
- the characters to test against the input buffer
java.lang.String extract(int start, int end)
String
from all character between the given indices.
Invalid indices are automatically adjusted to their respective boundary.
start
- the start index (inclusively)end
- the end index (exclusively)
InputBuffer.Position getPosition(int index)
InputBuffer.Position
object. The very first character has the line number 1 and the column number 1.
index
- the index of the character to get the line number of
java.lang.String extractLine(int lineNumber)
String
containing all characters with the given line number except for the trailing
newline.
lineNumber
- the line number to get
int getLineCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |