Package de.audioattack.io
Interface Console
-
- All Superinterfaces:
Flushable
- All Known Implementing Classes:
ConsolePrintDecorator
public interface Console extends Flushable
Mirrorsjava.io.Consoleto allow implementations to work as drop-in replacement for this class.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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
Reader reader()
Gets theReaderassociated with the console.- Returns:
- the reader
- See Also:
Console.reader()
-
writer
PrintWriter writer()
Gets thePrintWriterassociated with the console.- Returns:
- the writer
- See Also:
Console.writer()
-
format
Console format(String fmt, Object... args)
Writes formatted String.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
Console.format(String, Object...)
-
printf
Console printf(String fmt, Object... args)
Convenience method which writes formatted String.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- this console
- See Also:
Console.printf(String, Object...)
-
readLine
String readLine(String fmt, Object... args)
Writes formatted prompt and reads single line.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the line
- See Also:
Console.readLine(String, Object...)
-
readLine
String readLine()
Reads single line.- Returns:
- the line
- See Also:
Console.readLine()
-
readPassword
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.- Parameters:
fmt- format Stringargs- arguments to replace format specifiers in format String- Returns:
- the password
- See Also:
Console.readPassword(String, Object...)
-
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:
Console.readPassword()
-
-