|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--lolo.Input
A Scanner gets the characters from an Input instance.
Scanner,
Scanner.scan(lolo.Input)| Field Summary | |
protected char[] |
buffer
The characters are buffered in this buffer. |
protected int |
filled
buffer[filled] is the last character in the buffer. |
protected int |
mark
if mark is greater then 0, then all characters from buffer[mark] up to buffer[next-1] are not discarded. |
protected int |
next
buffer[next] is the next character. |
protected java.io.Reader |
reader
The character source. |
protected int |
startOfSymbol
Marks the position of the first character of a symbol. |
| Constructor Summary | |
Input(java.io.Reader reader,
int bufferSize)
Creates an instance. |
|
| Method Summary | |
static void |
main(java.lang.String[] args)
A simple test for the Input class. |
void |
mark()
Marks the position of the next character. |
int |
next()
Returns the character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached |
void |
pushBackToMarked()
Resets next to the marked position. |
protected void |
setStartSymbol()
Marks buffer[next] as the first character of a new symbol and the mark flag is turned off. |
java.lang.String |
toString()
returns "Input["+reader+"]". |
void |
unmark()
Unmarks the buffer. |
protected void |
unsetSymbol()
Unmarks which characters belong to a symbol. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected final java.io.Reader reader
protected char[] buffer
protected int next
protected int startOfSymbol
protected int mark
protected int filled
| Constructor Detail |
public Input(java.io.Reader reader,
int bufferSize)
reader - the character source.bufferSize - sets the initial buffer size.| Method Detail |
protected void setStartSymbol()
mark,
unsetSymbol()protected void unsetSymbol()
public int next()
throws java.io.IOException
public void mark()
public void unmark()
public void pushBackToMarked()
public java.lang.String toString()
toString in class java.lang.Object
public static void main(java.lang.String[] args)
throws java.lang.Exception
|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||