Class ObservableTask

java.lang.Object
net.ssehub.easy.basics.progress.ObservableTask

public class ObservableTask extends Object
Combines observable and task/subtask for convenient use.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • ObservableTask

      public ObservableTask(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(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(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 Details

    • 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.