private static class AbstractModule.ReaderHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
buffer
The line buffer containing the last line read.
|
private java.io.BufferedReader |
reader
The reader from which to read the text.
|
Modifier | Constructor and Description |
---|---|
protected |
ReaderHelper(java.io.BufferedReader reader)
Creates a new reader helper for the given buffered reader.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the reader.
|
boolean |
hasNext()
Checks, whether the reader contains a next line.
|
java.lang.String |
next()
Returns the next line.
|
void |
pushBack(java.lang.String line)
Pushes the given line back into the buffer.
|
protected java.lang.String |
readLine()
Reads the next line skipping all comment lines.
|
private java.lang.String buffer
private final java.io.BufferedReader reader
protected ReaderHelper(java.io.BufferedReader reader)
reader
- the buffered reader that is the source of the text.public boolean hasNext() throws java.io.IOException
java.io.IOException
- if an error occures.public java.lang.String next()
public void pushBack(java.lang.String line)
line
- the line that should be pushed back into the buffer.protected java.lang.String readLine() throws java.io.IOException
java.io.IOException
- if an IO error occures.public void close() throws java.io.IOException
java.io.IOException
- if an IOError occurs.