Package de.audioattack.io
Interface Console
- All Superinterfaces:
Flushable
- All Known Implementing Classes:
CharacterDevice,ConsolePrintDecorator
Mirrors
java.io.Console to allow implementations to work as drop-in replacement for this
class.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionWrites formatted String.Convenience method which writes formatted String.reader()Gets aReaderassociated with the console.readLine()Reads single line.Writes formatted prompt and reads single line.char[]Reads password.char[]readPassword(String fmt, Object... args) Writes formatted prompt and reads password.writer()Gets aPrintWriterassociated with the console.
-
Method Details
-
reader
Reader reader()Gets aReaderassociated with the console. Invokingclose()on this object will not close the underlying stream.- Returns:
- the reader
- See Also:
-
writer
PrintWriter writer()Gets aPrintWriterassociated with the console. Invokingclose()on this object will not close the underlying stream.- Returns:
- the writer
- See Also:
-
format
Writes formatted String.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
-
printf
Convenience method which writes formatted String.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
-
readLine
Writes formatted prompt and reads single line.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the line
- See Also:
-
readLine
String readLine()Reads single line.- Returns:
- the line
- See Also:
-
readPassword
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.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the password
- See Also:
-
readPassword
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.- Returns:
- the password
- See Also:
-