public interface TextTerminal<T extends TextTerminal<T>>
Modifier and Type | Method and Description |
---|---|
default void |
abort()
This method is typically called when a text-based input/output session has been aborted by the user or when a severe error occurred.
|
default void |
dispose()
This method is typically called at the end of a text-based input/output session in order to allow the terminal to release its screen resources.
|
TerminalProperties<T> |
getProperties() |
default void |
init()
This method is typically called after the terminal has been created.
|
default void |
print(List<String> messages)
Prints each message in the list, inserting the line separator string between messages.
|
default void |
print(String message)
Prints a message that possibly contains line separators.
|
default void |
printf(Locale l,
String format,
Object... args)
Prints a formatted string using the specified locale, format string and arguments.
|
default void |
printf(String format,
Object... args)
Prints a formatted string using the default locale and the specified format string and arguments.
|
void |
println()
Terminates the current line by writing the line separator string.
|
default void |
println(List<String> messages)
Prints each message in the list, inserting the line separator string between messages.
|
default void |
println(String message)
Prints a message that possibly contains line separators and subsequently prints a line separator.
|
default void |
rawPrint(List<String> messages)
Prints each message in the list in its raw form, inserting the line separator string between messages.
|
void |
rawPrint(String message)
Prints the message in its raw form.
|
String |
read(boolean masking)
Reads a line of text
|
boolean |
registerUserInterruptHandler(Consumer<T> handler,
boolean abortRead)
Registers a handler that will be called in response to a user interrupt.
|
String read(boolean masking)
masking
- true, if the input should be masked (for example to enter a password)void rawPrint(String message)
void println()
TerminalProperties<T> getProperties()
TerminalProperties
of this text terminal.boolean registerUserInterruptHandler(Consumer<T> handler, boolean abortRead)
handler
- the action to be performed in response to a user interrupt.abortRead
- true, if the current read operation should be aborted on user interrupt.default void init()
default void dispose()
default void abort()
default void rawPrint(List<String> messages)
default void print(String message)
default void println(String message)
default void print(List<String> messages)
default void println(List<String> messages)
default void printf(String format, Object... args)
format
- A format string as described in Formatter
.args
- Arguments referenced by the format specifiers in the format string.