Package de.audioattack.io
Class CharacterDevice
- java.lang.Object
-
- de.audioattack.io.CharacterDevice
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()Consoleformat(String fmt, Object... args)Writes formatted String.Consoleprintf(String fmt, Object... args)Convenience method which writes formatted String.Readerreader()Gets theReaderassociated with the console.StringreadLine()Reads single line.StringreadLine(String fmt, Object... args)Writes formatted prompt and reads single line.char[]readPassword()Reads password.char[]readPassword(String fmt, Object... args)Writes formatted prompt and reads password.PrintWriterwriter()Gets thePrintWriterassociated with the console.
-
-
-
Method Detail
-
reader
public Reader reader()
Gets theReaderassociated with the console. Invokingclose()on this object will not close the underlying stream.- Specified by:
readerin interfaceConsole- Returns:
- the reader
- See Also:
Console.reader()
-
writer
public PrintWriter writer()
Gets thePrintWriterassociated with the console. Invokingclose()on this object will not close the underlying stream.- Specified by:
writerin interfaceConsole- Returns:
- the writer
- See Also:
Console.writer()
-
format
public Console format(String fmt, Object... args)
Writes formatted String.- Specified by:
formatin interfaceConsole- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
Console.format(String, Object...)
-
printf
public Console printf(String fmt, Object... args)
Convenience method which writes formatted String.- Specified by:
printfin interfaceConsole- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
Console.printf(String, Object...)
-
readLine
public String readLine(String fmt, Object... args)
Writes formatted prompt and reads single line.- Specified by:
readLinein interfaceConsole- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the line
- See Also:
Console.readLine(String, Object...)
-
readLine
public String readLine()
Reads single line.- Specified by:
readLinein interfaceConsole- Returns:
- the line
- See Also:
Console.readLine()
-
readPassword
public char[] readPassword(String fmt, Object... args)
Writes formatted prompt and reads password. Hidden input should be preferred if possible. Implementations which cannot hide input should display a warning that entered text will be visible.- Specified by:
readPasswordin interfaceConsole- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the password
- See Also:
Console.readPassword(String, Object...)
-
readPassword
public char[] readPassword()
Reads password. Hidden input should be preferred if possible. Implementations which cannot hide input should display a warning that entered text will be visible.- Specified by:
readPasswordin interfaceConsole- Returns:
- the password
- See Also:
Console.readPassword()
-
-