Package edu.uiuc.ncsa.security.util.cli
Interface IOInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearQueue()Some implementations will have a queue e.g.voidflush()Flush anything waiting to be printed.booleanisBufferingOn()return current state of buffering.booleanisQueueEmpty()Check if the queue is empty.voidprint(Object x)Print the string representation of an object, without a carriage return.voidprintln(Object x)Print the string representation of an object with a carriage return.Stringreadline()Read a line of input with no prompt.Stringreadline(String prompt)read a line of input, printing the prompt (on the left) first.voidsetBufferingOn(boolean bufferOn)If this object supports buffering of commands, this will toggle it.
-
-
-
Method Detail
-
readline
String readline(String prompt) throws IOException
read a line of input, printing the prompt (on the left) first. The prompt is not returned.- Parameters:
prompt-- Returns:
- Throws:
IOException
-
readline
String readline() throws IOException
Read a line of input with no prompt.- Returns:
- Throws:
IOException
-
print
void print(Object x)
Print the string representation of an object, without a carriage return.- Parameters:
x-
-
println
void println(Object x)
Print the string representation of an object with a carriage return.- Parameters:
x-
-
flush
void flush()
Flush anything waiting to be printed. Normally this is done with the print methods.
-
clearQueue
void clearQueue()
Some implementations will have a queue e.g. if the user paste text from the clipboard). Thereadline(String)methods will queue these up and return them in sequence -- this is done silently. If for some reason you need only a single line and want to discard anything else, invoke this.
-
isQueueEmpty
boolean isQueueEmpty()
Check if the queue is empty.- Returns:
-
setBufferingOn
void setBufferingOn(boolean bufferOn)
If this object supports buffering of commands, this will toggle it. Buffering means that every result ofreadline(String)will be stored and up down arrows will cycle through them.- Parameters:
bufferOn-
-
isBufferingOn
boolean isBufferingOn()
return current state of buffering.- Returns:
-
-