kawigi.util
Class ProcessOutput

java.lang.Object
  extended by kawigi.util.ProcessOutput
All Implemented Interfaces:
java.lang.Runnable

public class ProcessOutput
extends java.lang.Object
implements java.lang.Runnable

A threaded output listener for a process output stream (either stdout or stderr).


Constructor Summary
ProcessOutput(java.io.InputStream out, ConsoleDisplay output)
          Creates a new ProcessOutput that reads out into output.
 
Method Summary
 ConsoleDisplay getOutputDisplay()
          Returns the display component being used by this thread.
 boolean isDone()
          Returns true if this output stream has stopped producing output.
 void run()
          Reads characters from the stream until it runs out of them.
 void start()
          Starts the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessOutput

public ProcessOutput(java.io.InputStream out,
                     ConsoleDisplay output)
Creates a new ProcessOutput that reads out into output.

Method Detail

start

public void start()
Starts the thread.


run

public void run()
Reads characters from the stream until it runs out of them. Flushes every line so there's a sort of compromise between speed and being able to see what's happened so far.

Specified by:
run in interface java.lang.Runnable

isDone

public boolean isDone()
Returns true if this output stream has stopped producing output.


getOutputDisplay

public ConsoleDisplay getOutputDisplay()
Returns the display component being used by this thread.