org.xnap.cmdl
Class ReadlineConsole

java.lang.Object
  extended by org.xnap.cmdl.ReadlineConsole
All Implemented Interfaces:
Console

public class ReadlineConsole
extends java.lang.Object
implements Console

A wrapper class for JavaReadline and the GNU Readline library.


Nested Class Summary
 class ReadlineConsole.MyCompleter
           
 
Constructor Summary
ReadlineConsole()
           
 
Method Summary
 Command getCommand(java.lang.String command)
          Returns the Command object that is associated with commandName.
 Command[] getCommands()
          Returns all supported commands.
 boolean isEchoing()
          Returns true, input is echoed on screen.
 void println(java.lang.String output)
          Prints to stdout.
 java.lang.String readln(java.lang.String prompt)
          Display a prompt on standard output and read a string from standard input.
 void saveSettings()
          This should be called when the application is closed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadlineConsole

public ReadlineConsole()
Method Detail

getCommand

public Command getCommand(java.lang.String command)
Description copied from interface: Console
Returns the Command object that is associated with commandName.

Specified by:
getCommand in interface Console
Returns:
null, if the command is not supported; the command, otherwise

getCommands

public Command[] getCommands()
Description copied from interface: Console
Returns all supported commands.

Specified by:
getCommands in interface Console

isEchoing

public boolean isEchoing()
Description copied from interface: Console
Returns true, input is echoed on screen.

Specified by:
isEchoing in interface Console

readln

public java.lang.String readln(java.lang.String prompt)
Display a prompt on standard output and read a string from standard input.

Specified by:
readln in interface Console
Parameters:
prompt - Prompt to display
Returns:
The string the user entered

println

public void println(java.lang.String output)
Prints to stdout.

Specified by:
println in interface Console
Parameters:
output - Text to show

saveSettings

public void saveSettings()
This should be called when the application is closed.



Copyright © 2001-2005 XNap Team. All Rights Reserved.