Package net.ssehub.easy.basics.progress
Class ObservableTask
java.lang.Object
net.ssehub.easy.basics.progress.ObservableTask
Combines observable and task/subtask for convenient use.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate ProgressObserverprivate ProgressObserver.ISubtaskprivate ProgressObserver.ITask -
Constructor Summary
ConstructorsConstructorDescriptionObservableTask(String name, int max, ObservableTask parent) Creates a new observable sub task.ObservableTask(String name, int max, ProgressObserver observer) Creates a new observable top-level task.ObservableTask(String name, int max, ProgressObserver observer, ProgressObserver.ITask task) Creates a new observable (sub) task. -
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies the observer about ending this (sub)task.voidNotifies the observer about progressing on step.voidnotifyProgress(int steps) Notifies the observer about progressing multiple steps.
-
Field Details
-
task
-
subtask
-
observer
-
count
private int count
-
-
Constructor Details
-
ObservableTask
Creates a new observable top-level task. Notifies the observer about starting the task.- Parameters:
name- the name of the taskmax- the maximum stepsobserver- the observer
-
ObservableTask
Creates a new observable (sub) task. Notifies the observer about starting the task.- Parameters:
name- the name of the taskmax- the maximum stepsobserver- the observertask- the parent task (may be null)
-
ObservableTask
Creates a new observable sub task. Notifies the observer about starting the task.- Parameters:
name- the name of the sub taskmax- the maximum stepsparent- 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.
-