Interface IMonitor

All Known Implementing Classes:
NullMonitor

public interface IMonitor
Interface for monitoring progress and cancellation of long-running operations. Provides support for work progress tracking, cancellation state management, and hierarchical monitoring through sub-monitors.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Checks if progress monitor has been cancelled.
    Creates a sub-monitor for tracking a portion of this monitor's work.
    boolean
    Returns whether this monitor has been canceled.
    void
    setCanceled(boolean cancelled)
    Sets the cancellation state of this monitor.
    void
    setWorkRemaining(int size)
    Sets the number of work units remaining for this monitor.
    void
    worked(int i)
    Notifies that a given number of work units have been completed.
  • Method Details

    • setCanceled

      void setCanceled(boolean cancelled)
      Sets the cancellation state of this monitor.
      Parameters:
      cancelled - true to cancel the operation, false otherwise
    • isCanceled

      boolean isCanceled()
      Returns whether this monitor has been canceled.
      Returns:
      true if the operation has been canceled, false otherwise
    • worked

      void worked(int i)
      Notifies that a given number of work units have been completed.
      Parameters:
      i - the number of work units completed
    • createSubMonitor

      IMonitor createSubMonitor()
      Creates a sub-monitor for tracking a portion of this monitor's work.
      Returns:
      a new sub-monitor instance
    • setWorkRemaining

      void setWorkRemaining(int size)
      Sets the number of work units remaining for this monitor.
      Parameters:
      size - the number of work units remaining
    • checkCancelled

      static void checkCancelled(IMonitor monitor) throws InterruptedException
      Checks if progress monitor has been cancelled.
      Parameters:
      monitor - the progress monitor to check
      Throws:
      InterruptedException - if monitor is cancelled