public class StreamPrinter extends java.lang.Object implements java.lang.Runnable, Stoppable
Copyright (C) Damian Ryan Eads, 2001. All Rights Reserved. ritopt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ritopt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ritopt; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Constructor and Description |
---|
StreamPrinter(java.io.InputStream s,
java.io.PrintStream p)
Constructs a new StreamPrinter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isStopped()
Returns whether this StreamPrinter has stopped processing.
|
void |
join()
Joins this StreamPrinter's thread with the other threads.
|
void |
run()
Start the StreamPrinter thread.
|
void |
setFlush(boolean flush)
Sets whether the output stream should be flushed after each output
step.
|
void |
setStop(Stoppable tostop)
Sets the object to stop when this object is finished.
|
void |
start()
Starts the thread associated with this StreamPrinter.
|
void |
stop()
Stops this StreamPrinter's processing.
|
public StreamPrinter(java.io.InputStream s, java.io.PrintStream p)
s
- The stream to read from.p
- The stream to output to.public void start() throws java.lang.InterruptedException
java.lang.InterruptedException
public void setStop(Stoppable tostop)
tostop
- The object to stop.public boolean isStopped()
public void setFlush(boolean flush)
flush
- A boolean value.public void stop()
public void join() throws java.lang.InterruptedException
java.lang.InterruptedException
public void run()
run
in interface java.lang.Runnable