public abstract class RunnableReader extends Object implements Runnable
Runnable that reads from a Reader a line at a time.
Subclasses determine what to do with the read data.| Constructor and Description |
|---|
RunnableReader(Reader reader)
Constructs a
RunnableReader. |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
read(String line)
Invoked after a line has been read.
|
void |
run()
Reads from the reader until:
end-of-file
an I/O error occurs
stop is invoked
|
void |
stop()
Indicates to the reader to stop.
|
public RunnableReader(Reader reader)
RunnableReader.reader - the reader to read frompublic void run()
stop is invokedpublic void stop()
protected abstract void read(String line) throws IOException
line - the lineIOException - for any I/O errorCopyright © 2001–2025. All rights reserved.