Package moa.tasks

Interface TaskMonitor

  • All Known Implementing Classes:
    NullMonitor, StandardTaskMonitor

    public interface TaskMonitor
    Interface representing a task monitor.
    Version:
    $Revision: 7 $
    Author:
    Richard Kirkby (rkirkby@cs.waikato.ac.nz)
    • Method Detail

      • setCurrentActivity

        void setCurrentActivity​(String activityDescription,
                                double fracComplete)
        Sets the description and the percentage done of the current activity.
        Parameters:
        activityDescription - the description of the current activity
        fracComplete - the percentage done of the current activity
      • setCurrentActivityDescription

        void setCurrentActivityDescription​(String activity)
        Sets the description of the current activity.
        Parameters:
        activity - the description of the current activity
      • setCurrentActivityFractionComplete

        void setCurrentActivityFractionComplete​(double fracComplete)
        Sets the percentage done of the current activity
        Parameters:
        fracComplete - the percentage done of the current activity
      • taskShouldAbort

        boolean taskShouldAbort()
        Gets whether the task should abort.
        Returns:
        true if the task should abort
      • resultPreviewRequested

        boolean resultPreviewRequested()
        Gets whether there is a request for preview the task result.
        Returns:
        true if there is a request for preview the task result
      • setLatestResultPreview

        void setLatestResultPreview​(Object latestPreview)
        Sets the current result to preview
        Parameters:
        latestPreview - the result to preview
      • getCurrentActivityDescription

        String getCurrentActivityDescription()
        Gets the description of the current activity.
        Returns:
        the description of the current activity
      • getCurrentActivityFractionComplete

        double getCurrentActivityFractionComplete()
        Gets the percentage done of the current activity
        Returns:
        the percentage done of the current activity
      • requestPause

        void requestPause()
        Requests the task monitored to pause.
      • requestResume

        void requestResume()
        Requests the task monitored to resume.
      • requestCancel

        void requestCancel()
        Requests the task monitored to cancel.
      • isPaused

        boolean isPaused()
        Gets whether the task monitored is paused.
        Returns:
        true if the task is paused
      • isCancelled

        boolean isCancelled()
        Gets whether the task monitored is cancelled.
        Returns:
        true if the task is cancelled
      • requestResultPreview

        void requestResultPreview()
        Requests to preview the task result.
      • requestResultPreview

        void requestResultPreview​(ResultPreviewListener toInform)
        Requests to preview the task result.
        Parameters:
        toInform - the listener of the changes in the preview of the result
      • getLatestResultPreview

        Object getLatestResultPreview()
        Gets the current result to preview
        Returns:
        the result to preview