Class ProgressBar

  • All Implemented Interfaces:
    ai.djl.util.Progress

    public final class ProgressBar
    extends java.lang.Object
    implements ai.djl.util.Progress
    ProgressBar is an implementation of Progress. It can be used to display the progress of a task in the form a bar.
    • Constructor Summary

      Constructors 
      Constructor Description
      ProgressBar()
      Creates an instance of ProgressBar with a maximum value of 1.
      ProgressBar​(java.lang.String message, long max)
      Creates an instance of ProgressBar with the given maximum value, and displays the given message.
      ProgressBar​(java.lang.String message, long max, java.lang.String trailingMessage)
      Creates an instance of ProgressBar with the given maximum value, and displays the given message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void end()
      void increment​(long increment)
      void reset​(java.lang.String message, long max, java.lang.String trailingMessage)
      void start​(long initialProgress)
      void update​(long progress, java.lang.String additionalMessage)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface ai.djl.util.Progress

        reset, update
    • Constructor Detail

      • ProgressBar

        public ProgressBar()
        Creates an instance of ProgressBar with a maximum value of 1.
      • ProgressBar

        public ProgressBar​(java.lang.String message,
                           long max)
        Creates an instance of ProgressBar with the given maximum value, and displays the given message.
        Parameters:
        message - the message to be displayed
        max - the maximum value
      • ProgressBar

        public ProgressBar​(java.lang.String message,
                           long max,
                           java.lang.String trailingMessage)
        Creates an instance of ProgressBar with the given maximum value, and displays the given message.
        Parameters:
        message - the message to be displayed
        max - the maximum value
        trailingMessage - the trailing message to be shown
    • Method Detail

      • reset

        public final void reset​(java.lang.String message,
                                long max,
                                java.lang.String trailingMessage)
        Specified by:
        reset in interface ai.djl.util.Progress
      • start

        public void start​(long initialProgress)
        Specified by:
        start in interface ai.djl.util.Progress
      • end

        public void end()
        Specified by:
        end in interface ai.djl.util.Progress
      • increment

        public void increment​(long increment)
        Specified by:
        increment in interface ai.djl.util.Progress
      • update

        public void update​(long progress,
                           java.lang.String additionalMessage)
        Specified by:
        update in interface ai.djl.util.Progress