com.generationjava.io
Class CommandLine

java.lang.Object
  |
  +--com.generationjava.io.CommandLine

public class CommandLine
extends java.lang.Object

Read lines from a Command Line. This allows the code that deals with the commands to be independent of the command-reading.


Constructor Summary
CommandLine(java.io.InputStream is, com.generationjava.io.CommandLineListener cll)
          Create a CommandLine with the InputStream to read commands from and the CommandLineListener to send commands to.
CommandLine(java.io.Reader rdr, com.generationjava.io.CommandLineListener cll)
          Create a CommandLine with the Reader to read commands from and the CommandLineListener to send commands to.
 
Method Summary
 java.lang.String getPrompt()
          Get the prompt which will be ignored by the CommandLine.
 void setPrompt(java.lang.String s)
          Set a prompt to ignore.
 void startReading()
          Start the CommandLine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLine

public CommandLine(java.io.InputStream is,
                   com.generationjava.io.CommandLineListener cll)
Create a CommandLine with the InputStream to read commands from and the CommandLineListener to send commands to.


CommandLine

public CommandLine(java.io.Reader rdr,
                   com.generationjava.io.CommandLineListener cll)
Create a CommandLine with the Reader to read commands from and the CommandLineListener to send commands to.

Method Detail

setPrompt

public void setPrompt(java.lang.String s)
Set a prompt to ignore.


getPrompt

public java.lang.String getPrompt()
Get the prompt which will be ignored by the CommandLine.


startReading

public void startReading()
                  throws java.io.IOException
Start the CommandLine.

java.io.IOException


Copyright © 2000-2003 OSJava. All Rights Reserved.