Class ObservableTask


  • public class ObservableTask
    extends java.lang.Object
    Combines observable and task/subtask for convenient use.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ObservableTask

        public ObservableTask​(java.lang.String name,
                              int max,
                              ProgressObserver observer)
        Creates a new observable top-level task. Notifies the observer about starting the task.
        Parameters:
        name - the name of the task
        max - the maximum steps
        observer - the observer
      • ObservableTask

        public ObservableTask​(java.lang.String name,
                              int max,
                              ProgressObserver observer,
                              ProgressObserver.ITask task)
        Creates a new observable (sub) task. Notifies the observer about starting the task.
        Parameters:
        name - the name of the task
        max - the maximum steps
        observer - the observer
        task - the parent task (may be null)
      • ObservableTask

        public ObservableTask​(java.lang.String name,
                              int max,
                              ObservableTask parent)
        Creates a new observable sub task. Notifies the observer about starting the task.
        Parameters:
        name - the name of the sub task
        max - the maximum steps
        parent - The parent task
    • Method Detail

      • notifyProgress

        public void notifyProgress()
        Notifies the observer about progressing on step.
      • notifyProgress

        public void notifyProgress​(int steps)
        Notifies the observer about progressing multiple steps.
        Parameters:
        steps - the progressed steps
      • notifyEnd

        public void notifyEnd()
        Notifies the observer about ending this (sub)task.