org.apache.qpid.tools.utils
Class SimpleConsole
java.lang.Object
org.apache.qpid.tools.utils.SimpleConsole
- All Implemented Interfaces:
- Console
public class SimpleConsole
- extends Object
- implements Console
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_consoleWriter
protected BufferedWriter _consoleWriter
- Console Writer.
_consoleReader
protected BufferedReader _consoleReader
- Console Reader.
_parser
protected CommandParser _parser
- Parser for command-line input.
SimpleConsole
public SimpleConsole(BufferedWriter writer,
BufferedReader reader)
print
public void print(String... message)
- Specified by:
print
in interface Console
println
public void println(String... message)
- Specified by:
println
in interface Console
readln
public String readln()
- Specified by:
readln
in interface Console
readCommand
public String[] readCommand()
- Description copied from interface:
Console
- Reads and parses the command line.
- Specified by:
readCommand
in interface Console
- Returns:
- The next command or null
getCommandParser
public CommandParser getCommandParser()
- Specified by:
getCommandParser
in interface Console
setCommandParser
public void setCommandParser(CommandParser parser)
- Specified by:
setCommandParser
in interface Console
displayList
public void displayList(boolean hasTitle,
String... list)
- Description copied from interface:
Console
- Prints the list of String nicely.
+-------------+
| Heading |
+-------------+
| Item 1 |
| Item 2 |
| Item 3 |
+-------------+
- Specified by:
displayList
in interface Console
- Parameters:
hasTitle
- should list[0] be used as a headinglist
- The list of Strings to display
printMap
public void printMap(String title,
List<List> entries)
- Prints the list of String nicely.
+----------------------------+
| Heading |
+----------------------------+
| title | title | ..
+----------------------------+
| Item 2 | value 2 | ..
| Item 3 | value 2 | ..
+----------------------------+
- Specified by:
printMap
in interface Console
- Parameters:
title
- The title to display if anyentries
- the entries to display in a map.
close
public void close()
- Specified by:
close
in interface Console
Licensed to the Apache Software Foundation