Package me.tongfei.progressbar
Class TerminalUtils
java.lang.Object
me.tongfei.progressbar.TerminalUtils
- Since:
- 0.9.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static Queue<ProgressBarConsumer> (package private) static final charprivate static boolean(package private) static final int(package private) static final charprivate static org.jline.terminal.Terminal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static void(package private) static <T extends ProgressBarConsumer>
Stream<T> filterActiveConsumers(Class<T> clazz) (package private) static org.jline.terminal.TerminalCreating terminal is relatively expensive, usually takes between 5-10ms.(package private) static int(package private) static boolean(package private) static StringmoveCursorDown(int count) (package private) static StringmoveCursorUp(int count)
-
Field Details
-
CARRIAGE_RETURN
static final char CARRIAGE_RETURN- See Also:
-
ESCAPE_CHAR
static final char ESCAPE_CHAR- See Also:
-
DEFAULT_TERMINAL_WIDTH
static final int DEFAULT_TERMINAL_WIDTH- See Also:
-
terminal
private static org.jline.terminal.Terminal terminal -
cursorMovementSupported
private static boolean cursorMovementSupported -
activeConsumers
-
-
Constructor Details
-
TerminalUtils
public TerminalUtils()
-
-
Method Details
-
getTerminalWidth
static int getTerminalWidth() -
hasCursorMovementSupport
static boolean hasCursorMovementSupport() -
closeTerminal
static void closeTerminal() -
filterActiveConsumers
-
moveCursorUp
-
moveCursorDown
-
getTerminal
static org.jline.terminal.Terminal getTerminal()- Creating terminal is relatively expensive, usually takes between 5-10ms.
- If updateInterval is set under 10ms creating new terminal for on every re-render of progress bar could be a problem.
- Especially when multiple progress bars are running in parallel.
- Another problem with
Terminalis that once created you can create another instance (say from different thread), but this instance will be "dumb". Until previously created terminal will be closed.
- Creating terminal is relatively expensive, usually takes between 5-10ms.
-