Class Terminal<T>
java.lang.Object
pretty.Terminal<T>
- Type Parameters:
T- T - type of the keys
Manage terminal input and output
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a terminal with the default key translatorstatic <K> Terminal<K> build(KeyTranslator<K> translator) Build a terminal with a custom key translatorvoidclear()Clear the terminal screenkey()Return the next key pressed and translated by KeyTranslatorPrint a prompt to the terminal and return the next line as Scanner's methodvoidsetTranslator(KeyTranslator<T> translator) Set the key translatorvoidstart()Start the terminal, called by default in Menu
-
Method Details
-
build
-
build
Build a terminal with a custom key translator- Type Parameters:
K- K - type of the keys- Parameters:
translator- - custom key translator- Returns:
- terminal instance
-
start
public void start()Start the terminal, called by default in Menu -
clear
public void clear()Clear the terminal screen -
nextLine
-
key
-
setTranslator
Set the key translator- Parameters:
translator- - key translator
-