Interface IProgressCallback

All Known Implementing Classes:
ProgressCallbackAdapter

public interface IProgressCallback
Progress callback interface, used by various types to provide progress information about an on-going task. Methods involving lengthy operations (referred to as 'provider') sometimes accept such objects and use them to provide progress information to the caller (referred to as 'client').
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    long
     
    long
     
    default boolean
    Determine whether this object is initialized.
    void
    message(int id, String msg)
    This method is used by the provider to send a transient message to its client.
    default void
    This method is used by the provider to send a transient message to its client, with id 0.
    void
    setCurrent(long current)
    This method is called by a provider to update the current computation count.
    void
    setTotal(long total)
    This method called by a provider (generally once) to set an initial (possibly estimate) computation count.
    void
    updateTotal(long count)
    Set or update the total by the provided unit amount.
  • Method Details

    • isInitialized

      default boolean isInitialized()
      Determine whether this object is initialized.
      Returns:
    • setTotal

      void setTotal(long total)
      This method called by a provider (generally once) to set an initial (possibly estimate) computation count. The number in itself is arbitrary.
      Parameters:
      total -
    • getTotal

      long getTotal()
      Returns:
    • updateTotal

      void updateTotal(long count)
      Set or update the total by the provided unit amount. If the total had been set, it is updated; else, it is set.
      Parameters:
      count -
    • setCurrent

      void setCurrent(long current)
      This method is called by a provider to update the current computation count. Together with the total count, a client may compute an estimated completion ratio.
      Parameters:
      current -
    • getCurrent

      long getCurrent()
      Returns:
    • increment

      long increment()
      Returns:
      the incremented value
    • message

      default void message(String msg)
      This method is used by the provider to send a transient message to its client, with id 0. It is the same as message(0, msg).
      Parameters:
      msg -
    • message

      void message(int id, String msg)
      This method is used by the provider to send a transient message to its client.
      Parameters:
      id - message id (0 or 1)
      msg - message string