Class 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 default System.err is used as PrintStream.
    Author:
    Tongfei Chen, Alex Peelman
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(java.lang.String str)
      Accepts a rendered form of a progress bar, e.g., prints to a specified stream.
      void close()  
      int getMaxRenderedLength()
      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 java.util.function.Consumer

        andThen
    • Constructor Detail

      • ConsoleProgressBarConsumer

        public ConsoleProgressBarConsumer​(java.io.PrintStream out)
      • ConsoleProgressBarConsumer

        public ConsoleProgressBarConsumer​(java.io.PrintStream out,
                                          int maxRenderedLength)
    • Method Detail

      • accept

        public void accept​(java.lang.String str)
        Description copied from interface: ProgressBarConsumer
        Accepts a rendered form of a progress bar, e.g., prints to a specified stream.
        Specified by:
        accept in interface java.util.function.Consumer<java.lang.String>
        Specified by:
        accept in interface ProgressBarConsumer
        Parameters:
        str - Rendered form of a progress bar, a string
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ProgressBarConsumer