- java.lang.Object
-
- me.tongfei.progressbar.ConsoleProgressBarConsumer
-
- All Implemented Interfaces:
java.lang.Appendable,java.lang.AutoCloseable,java.util.function.Consumer<java.lang.String>,ProgressBarConsumer
- Direct Known Subclasses:
InteractiveConsoleProgressBarConsumer
public class ConsoleProgressBarConsumer extends java.lang.Object implements ProgressBarConsumer
Progress bar consumer that prints the progress bar state to console. By defaultSystem.erris used asPrintStream.- Author:
- Tongfei Chen, Alex Peelman
-
-
Constructor Summary
Constructors Constructor Description ConsoleProgressBarConsumer(java.io.PrintStream out)ConsoleProgressBarConsumer(java.io.PrintStream out, int maxRenderedLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(java.lang.String str)Accepts a rendered form of a progress bar, e.g., prints to a specified stream.voidclose()intgetMaxRenderedLength()Returns 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, wait
-
Methods inherited from interface me.tongfei.progressbar.ProgressBarConsumer
append, append, append, clear
-
-
-
-
Method Detail
-
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
public void accept(java.lang.String str)
Description copied from interface:ProgressBarConsumerAccepts a rendered form of a progress bar, e.g., prints to a specified stream.- Specified by:
acceptin interfacejava.util.function.Consumer<java.lang.String>- Specified by:
acceptin interfaceProgressBarConsumer- Parameters:
str- Rendered form of a progress bar, a string
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceProgressBarConsumer
-
-