ptolemy.actor.lib
Class Exec._StreamReaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by ptolemy.actor.lib.Exec._StreamReaderThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Exec

private class Exec._StreamReaderThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  Nameable _actor
           
private  java.io.InputStream _inputStream
           
private  java.io.InputStreamReader _inputStreamReader
           
private  boolean _inputStreamReaderClosed
           
private  java.lang.StringBuffer _stringBuffer
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Exec._StreamReaderThread(java.io.InputStream inputStream, java.lang.String name, Nameable actor)
          Create a _StreamReaderThread.
 
Method Summary
private  void _read()
           
 java.lang.String getAndReset()
          Read any remaining data in the input stream and return the data read thus far.
 void run()
          Read lines from the inputStream and append them to the stringBuffer.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_actor

private Nameable _actor

_inputStream

private java.io.InputStream _inputStream

_inputStreamReader

private java.io.InputStreamReader _inputStreamReader

_inputStreamReaderClosed

private boolean _inputStreamReaderClosed

_stringBuffer

private java.lang.StringBuffer _stringBuffer
Constructor Detail

Exec._StreamReaderThread

Exec._StreamReaderThread(java.io.InputStream inputStream,
                         java.lang.String name,
                         Nameable actor)
Create a _StreamReaderThread.

Parameters:
inputStream - The stream to read from.
name - The name of this StreamReaderThread, which is useful for debugging.
actor - The parent actor of this thread, which is used in error messages.
Method Detail

getAndReset

public java.lang.String getAndReset()
Read any remaining data in the input stream and return the data read thus far. Calling this method resets the cache of data read thus far.


run

public void run()
Read lines from the inputStream and append them to the stringBuffer.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

_read

private void _read()