Package org.jfree.base.modules
Class AbstractModule.ReaderHelper
- java.lang.Object
-
- org.jfree.base.modules.AbstractModule.ReaderHelper
-
- Enclosing class:
- AbstractModule
private static class AbstractModule.ReaderHelper extends java.lang.ObjectThe reader helper provides a pushback interface for the reader to read and buffer complete lines.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedReaderHelper(java.io.BufferedReader reader)Creates a new reader helper for the given buffered reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the reader.booleanhasNext()Checks, whether the reader contains a next line.java.lang.Stringnext()Returns the next line.voidpushBack(java.lang.String line)Pushes the given line back into the buffer.protected java.lang.StringreadLine()Reads the next line skipping all comment lines.
-
-
-
Method Detail
-
hasNext
public boolean hasNext() throws java.io.IOExceptionChecks, whether the reader contains a next line. Returns false if the end of the stream has been reached.- Returns:
- true, if there is a next line to read, false otherwise.
- Throws:
java.io.IOException- if an error occures.
-
next
public java.lang.String next()
Returns the next line.- Returns:
- the next line.
-
pushBack
public void pushBack(java.lang.String line)
Pushes the given line back into the buffer. Only one line can be contained in the buffer at one time.- Parameters:
line- the line that should be pushed back into the buffer.
-
readLine
protected java.lang.String readLine() throws java.io.IOExceptionReads the next line skipping all comment lines.- Returns:
- the next line, or null if no line can be read.
- Throws:
java.io.IOException- if an IO error occures.
-
close
public void close() throws java.io.IOExceptionCloses the reader.- Throws:
java.io.IOException- if an IOError occurs.
-
-