Package me.tongfei.progressbar
Class ConsoleProgressBarConsumer
java.lang.Object
me.tongfei.progressbar.ConsoleProgressBarConsumer
- All Implemented Interfaces:
Appendable,AutoCloseable,Consumer<String>,ProgressBarConsumer
- Direct Known Subclasses:
InteractiveConsoleProgressBarConsumer
Progress bar consumer that prints the progress bar state to console.
By default
System.err is used as PrintStream.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static int(package private) int(package private) final PrintStream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts a rendered form of a progress bar, e.g., prints to a specified stream.voidclose()intReturns the maximum length allowed for the rendered form of a progress bar.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.tongfei.progressbar.ProgressBarConsumer
append, append, append, clear
-
Field Details
-
consoleRightMargin
private static int consoleRightMargin -
maxRenderedLength
int maxRenderedLength -
out
-
-
Constructor Details
-
ConsoleProgressBarConsumer
-
ConsoleProgressBarConsumer
-
-
Method Details
-
getMaxRenderedLength
public int getMaxRenderedLength()Description copied from interface:ProgressBarConsumerReturns the maximum length allowed for the rendered form of a progress bar.- Specified by:
getMaxRenderedLengthin interfaceProgressBarConsumer
-
accept
Description copied from interface:ProgressBarConsumerAccepts a rendered form of a progress bar, e.g., prints to a specified stream.- Specified by:
acceptin interfaceConsumer<String>- Specified by:
acceptin interfaceProgressBarConsumer- Parameters:
str- Rendered form of a progress bar, a string
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceProgressBarConsumer
-