Class DelegatingProgressBarConsumer

  • All Implemented Interfaces:
    java.lang.Appendable, java.lang.AutoCloseable, java.util.function.Consumer<java.lang.String>, ProgressBarConsumer

    public class DelegatingProgressBarConsumer
    extends java.lang.Object
    implements ProgressBarConsumer
    Progress bar consumer that delegates the progress bar handling to a custom Consumer.
    Since:
    0.8.0
    Author:
    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

      • DelegatingProgressBarConsumer

        public DelegatingProgressBarConsumer​(java.util.function.Consumer<java.lang.String> consumer)
      • DelegatingProgressBarConsumer

        public DelegatingProgressBarConsumer​(java.util.function.Consumer<java.lang.String> consumer,
                                             int maxProgressLength)
    • 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