Package ucar.nc2.util

Interface CancelTask

All Known Implementing Classes:
CancelTaskImpl

public interface CancelTask
Allows long tasks to be cancelled. Used in potentially long method calls which the user may want the option to cancel.
  • Method Summary

    Modifier and Type
    Method
    Description
    static CancelTask
     
    boolean
    Calling routine may cancel, called routine checks this method, and if true, return asap.
    boolean
    Application calls to see if task is done.
    void
    setDone(boolean done)
    Called routine sets operation was completed.
    void
    Called routine got an error, so it sets a message for calling program to show to user.
    void
    setProgress(String msg, int progress)
    Called routine may optionally show a progress message for calling program to show to user.
    default void
    Called routine sets whether operation successfully completed.
  • Method Details

    • create

      static CancelTask create()
    • isCancel

      boolean isCancel()
      Calling routine may cancel, called routine checks this method, and if true, return asap.
      Returns:
      true if task was cancelled
    • isDone

      boolean isDone()
      Application calls to see if task is done.
    • setDone

      void setDone(boolean done)
      Called routine sets operation was completed.
    • setSuccess

      default void setSuccess()
      Called routine sets whether operation successfully completed.
    • setError

      void setError(String msg)
      Called routine got an error, so it sets a message for calling program to show to user.
      Parameters:
      msg - message to show user
    • setProgress

      void setProgress(String msg, int progress)
      Called routine may optionally show a progress message for calling program to show to user.
      Parameters:
      msg - message to show user
      progress - count of progress