|
Gridarta Editor
|
Copies a Reader into a String. More...
Collaboration diagram for net.sf.gridarta.utils.CopyReader:Public Member Functions | |
| CopyReader (@NotNull final Reader reader) | |
| Creates a new instance. More... | |
| String | getFailure () |
| Returns the failure reason. More... | |
| String | getOutput () |
| Returns the reader's output. More... | |
| void | join () throws InterruptedException |
| Waits for the worker thread to terminate. More... | |
| void | start () |
| Starts reading. More... | |
| void | stop () |
| Stops reading. More... | |
Private Member Functions | |
| void | setFailure (@NotNull final String failure) |
| Sets the failure reason. More... | |
Private Attributes | |
| final CharArrayWriter | charArrayWriter = new CharArrayWriter() |
| The CharArrayWriter collecting data read from reader. More... | |
| String | failure |
| The failure reason. More... | |
| final Reader | reader |
| The Reader to read from. More... | |
| final Runnable | runnable |
| The Runnable implementing the worker thread. More... | |
| boolean | stopped |
| Whether the worker thread was stopped. More... | |
| final Object | sync = new Object() |
| The synchronization object for accessing stopped, failure, and charArrayWriter. More... | |
| final Thread | thread = new Thread(runnable) |
| The worker Thread executing runnable. More... | |
Copies a Reader into a String.
Definition at line 32 of file CopyReader.java.
| net.sf.gridarta.utils.CopyReader.CopyReader | ( | @NotNull final Reader | reader | ) |
Creates a new instance.
| reader | the reader to read from |
Definition at line 103 of file CopyReader.java.
References net.sf.gridarta.utils.CopyReader.reader.
| String net.sf.gridarta.utils.CopyReader.getFailure | ( | ) |
Returns the failure reason.
Definition at line 141 of file CopyReader.java.
References net.sf.gridarta.utils.CopyReader.failure, net.sf.gridarta.utils.CopyReader.stopped, net.sf.gridarta.utils.CopyReader.sync, and net.sf.gridarta.utils.CopyReader.thread.
Here is the caller graph for this function:| String net.sf.gridarta.utils.CopyReader.getOutput | ( | ) |
Returns the reader's output.
Definition at line 154 of file CopyReader.java.
References net.sf.gridarta.utils.CopyReader.charArrayWriter, net.sf.gridarta.utils.CopyReader.stopped, net.sf.gridarta.utils.CopyReader.sync, and net.sf.gridarta.utils.CopyReader.thread.
Here is the caller graph for this function:| void net.sf.gridarta.utils.CopyReader.join | ( | ) | throws InterruptedException |
Waits for the worker thread to terminate.
| InterruptedException | if the current thread was interrupted waiting for the worker thread to terminate |
Definition at line 167 of file CopyReader.java.
References net.sf.gridarta.utils.CopyReader.thread.
|
private |
Sets the failure reason.
Does nothing if a preceding failure reason was recorded.
| failure | the failure reason |
Definition at line 127 of file CopyReader.java.
References net.sf.gridarta.utils.CopyReader.failure, and net.sf.gridarta.utils.CopyReader.sync.
| void net.sf.gridarta.utils.CopyReader.start | ( | ) |
Starts reading.
Definition at line 110 of file CopyReader.java.
Here is the caller graph for this function:| void net.sf.gridarta.utils.CopyReader.stop | ( | ) |
Stops reading.
Definition at line 117 of file CopyReader.java.
Here is the caller graph for this function:
|
private |
The CharArrayWriter collecting data read from reader.
Definition at line 51 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.getOutput().
|
private |
The failure reason.
Set to
if no failure occurred.
Definition at line 62 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.getFailure(), and net.sf.gridarta.utils.CopyReader.setFailure().
|
private |
The Reader to read from.
Definition at line 38 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.CopyReader().
|
private |
The Runnable implementing the worker thread.
Definition at line 68 of file CopyReader.java.
|
private |
Whether the worker thread was stopped.
Definition at line 56 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.getFailure(), and net.sf.gridarta.utils.CopyReader.getOutput().
|
private |
The synchronization object for accessing stopped, failure, and charArrayWriter.
Definition at line 45 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.getFailure(), net.sf.gridarta.utils.CopyReader.getOutput(), and net.sf.gridarta.utils.CopyReader.setFailure().
|
private |
The worker Thread executing runnable.
Definition at line 97 of file CopyReader.java.
Referenced by net.sf.gridarta.utils.CopyReader.getFailure(), net.sf.gridarta.utils.CopyReader.getOutput(), and net.sf.gridarta.utils.CopyReader.join().