Interface ProgressMonitor

All Known Implementing Classes:
BatchingProgressMonitor, EmptyProgressMonitor, NullProgressMonitor, SideBandProgressMonitor, StrictWorkMonitor, TextProgressMonitor, ThreadSafeProgressMonitor

public interface ProgressMonitor
A progress reporting interface.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Constant indicating the total work units cannot be predicted.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beginTask(String title, int totalWork)
    Begin processing a single task.
    void
    Finish the current task, so the next can begin.
    boolean
    Check for user task cancellation.
    void
    start(int totalTasks)
    Advise the monitor of the total number of subtasks.
    void
    update(int completed)
    Denote that some work units have been completed.
  • Field Details

    • UNKNOWN

      static final int UNKNOWN
      Constant indicating the total work units cannot be predicted.
      See Also:
  • Method Details

    • start

      void start(int totalTasks)
      Advise the monitor of the total number of subtasks.

      This should be invoked at most once per progress monitor interface.

      Parameters:
      totalTasks - the total number of tasks the caller will need to complete their processing.
    • beginTask

      void beginTask(String title, int totalWork)
      Begin processing a single task.
      Parameters:
      title - title to describe the task. Callers should publish these as stable string constants that implementations could match against for translation support.
      totalWork - total number of work units the application will perform; UNKNOWN if it cannot be predicted in advance.
    • update

      void update(int completed)
      Denote that some work units have been completed.

      This is an incremental update; if invoked once per work unit the correct value for our argument is 1, to indicate a single unit of work has been finished by the caller.

      Parameters:
      completed - the number of work units completed since the last call.
    • endTask

      void endTask()
      Finish the current task, so the next can begin.
    • isCancelled

      boolean isCancelled()
      Check for user task cancellation.
      Returns:
      true if the user asked the process to stop working.