org.browsecode.helpers.controlcomputer
Class InputReaderThread

java.lang.Object
  extended by org.browsecode.helpers.controlcomputer.InputReaderThread
All Implemented Interfaces:
java.lang.Runnable

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


Constructor Summary
InputReaderThread(java.io.InputStream inputStream)
          Sets up and starts running the reader, plugging everything back into the vector addLinesToThisVector
InputReaderThread(java.io.InputStream inputStream, java.lang.Runnable runWhenDone)
          Sets up and starts running the reader, plugging everything back into the vector addLinesToThisVector
 
Method Summary
 int findTextInOutput(java.lang.String find, int lineToStartOn)
           
 java.util.Vector findTextInOutput(java.lang.String find, int lineToStartOn, int characterOnLineToStartAt)
           
 int getCurrentReadCharacter()
           
 int getCurrentReadLine()
           
 java.lang.String getDescriptorString()
           
 java.lang.String getLinesString()
           
 java.lang.String getLinesStringWithLineNumbers()
           
 java.util.Vector getLinesVector()
           
 javax.swing.text.JTextComponent getTextComponentToUpdate()
          this is for debugging purposes
 int haveFoundAnyOfTheseYet(java.lang.String[] waitFor)
           
 boolean isRunning()
           
 void run()
           
 void setCurrentReadCharacter(int i)
           
 void setCurrentReadLine(int i)
           
 void setCurrentReadToHere()
          Clear the reading point to this point, so that it won't search for stuff that came from previous commands to this thread.
 void setDescriptorString(java.lang.String string)
           
 void setTextComponentToUpdate(javax.swing.text.JTextComponent component)
          this is for debugging purposes
 void setThreadShouldDie(boolean shouldDie)
           
 int waitForResponse(java.lang.String[] waitFor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputReaderThread

public InputReaderThread(java.io.InputStream inputStream)
Sets up and starts running the reader, plugging everything back into the vector addLinesToThisVector


InputReaderThread

public InputReaderThread(java.io.InputStream inputStream,
                         java.lang.Runnable runWhenDone)
Sets up and starts running the reader, plugging everything back into the vector addLinesToThisVector

Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

isRunning

public boolean isRunning()

getLinesVector

public java.util.Vector getLinesVector()

getLinesString

public java.lang.String getLinesString()

getLinesStringWithLineNumbers

public java.lang.String getLinesStringWithLineNumbers()

getCurrentReadCharacter

public int getCurrentReadCharacter()

getCurrentReadLine

public int getCurrentReadLine()

setCurrentReadCharacter

public void setCurrentReadCharacter(int i)

setCurrentReadLine

public void setCurrentReadLine(int i)

setCurrentReadToHere

public void setCurrentReadToHere()
Clear the reading point to this point, so that it won't search for stuff that came from previous commands to this thread.


getTextComponentToUpdate

public javax.swing.text.JTextComponent getTextComponentToUpdate()
this is for debugging purposes


setTextComponentToUpdate

public void setTextComponentToUpdate(javax.swing.text.JTextComponent component)
this is for debugging purposes


setThreadShouldDie

public void setThreadShouldDie(boolean shouldDie)

findTextInOutput

public java.util.Vector findTextInOutput(java.lang.String find,
                                         int lineToStartOn,
                                         int characterOnLineToStartAt)
Parameters:
find -
lineToStartOn -
characterOnLine -
Returns:
Vector -- a tuple of two Integers -- the line it found and the character that the text starts at

findTextInOutput

public int findTextInOutput(java.lang.String find,
                            int lineToStartOn)

haveFoundAnyOfTheseYet

public int haveFoundAnyOfTheseYet(java.lang.String[] waitFor)

waitForResponse

public int waitForResponse(java.lang.String[] waitFor)

getDescriptorString

public java.lang.String getDescriptorString()
Returns:

setDescriptorString

public void setDescriptorString(java.lang.String string)
Parameters:
string -