Package wsh.util

Interface Monitor

  • All Known Implementing Classes:
    LogMonitor, PartialMonitor

    public interface Monitor
    Implement this interface to receive notifications of progress
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Monitor NULL_MONITOR
      Empty implementation that does nothing.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void initReport​(double initFraction)
      Initialize the fraction of the work that was completed when the process started.
      boolean isCanceled()
      If true, then any further progress should be cancelled.
      void report​(double fraction)
      This method will be called with the current fraction of work done.
    • Field Detail

      • NULL_MONITOR

        static final Monitor NULL_MONITOR
        Empty implementation that does nothing.
    • Method Detail

      • initReport

        void initReport​(double initFraction)
        Initialize the fraction of the work that was completed when the process started. If not called, then assumed to be 0.
        Parameters:
        initFraction - Fraction of work done when process started, from 0 to 1.
      • report

        void report​(double fraction)
        This method will be called with the current fraction of work done. Values range from 0 at the beginning to 1 when all work is done.
        Parameters:
        fraction - Fraction of work done so far, from 0 to 1. This value must equal or exceed all values previously passed to this method or to initReport.
      • isCanceled

        boolean isCanceled()
        If true, then any further progress should be cancelled.
        Returns:
        true, when any requested work should be interrupted. False, if progress is expected to run to completion.