Package net.ssehub.easy.basics.progress
Class BasicProgressObserver
java.lang.Object
net.ssehub.easy.basics.progress.ProgressObserver
net.ssehub.easy.basics.progress.BasicProgressObserver
A basic, eclipse-like progress observer.
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSimple progress monitor interface.private static classRepresentation of a task, which will be observed by theBasicProgressObserver.IProgressMonitor.Nested classes/interfaces inherited from class net.ssehub.easy.basics.progress.ProgressObserver
ProgressObserver.ISubtask, ProgressObserver.ITask -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BasicProgressObserver.Taskprivate List<BasicProgressObserver.Task> Fields inherited from class net.ssehub.easy.basics.progress.ProgressObserver
NO_OBSERVER, NO_SUBTASK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyEnd(ProgressObserver.ITask task, ProgressObserver.ISubtask subtask) Notifies about ending a (sub)task.voidnotifyProgress(ProgressObserver.ITask task, ProgressObserver.ISubtask subtask, int step, int max) Notifies about processing a task or a subtask.voidnotifyStart(ProgressObserver.ITask task, ProgressObserver.ISubtask subtask, int max) Notifies about starting a (sub)task.voidSets the monitor to this progress observer.registerSubtask(String subtask) Registers a subtask to notify about processing progress.registerTask(String task) Registers a task for notify about processing progress.voidSets this monitor to null if the current monitor is the same as the specified monitor.Methods inherited from class net.ssehub.easy.basics.progress.ProgressObserver
notifyEnd, notifyProgress, notifyProgress, notifyProgress, notifyStart
-
Field Details
-
monitor
-
parent
-
subtasks
-
-
Constructor Details
-
BasicProgressObserver
public BasicProgressObserver()
-
-
Method Details
-
register
Sets the monitor to this progress observer.
Overwrites already set monitors.- Parameters:
monitor- The monitor which should be added to this observer.
-
unregister
Sets this monitor to null if the current monitor is the same as the specified monitor.- Parameters:
monitor- If the given monitor is the same monitor as the monitor of this observer instance the monitor of this observer will be set to null otherwise will nothing happen.
-
registerTask
Description copied from class:ProgressObserverRegisters a task for notify about processing progress.- Specified by:
registerTaskin classProgressObserver- Parameters:
task- the name of the task- Returns:
- the task identification
-
registerSubtask
Description copied from class:ProgressObserverRegisters a subtask to notify about processing progress.- Specified by:
registerSubtaskin classProgressObserver- Parameters:
subtask- the name of the sub task- Returns:
- the task identification
-
notifyStart
Description copied from class:ProgressObserverNotifies about starting a (sub)task. Subtask notifications shall occur after task notifications, i.e. nested.- Specified by:
notifyStartin classProgressObserver- Parameters:
task- the identification of task to notify about (initially useProgressObserver.registerTask(String)for registering a task)subtask- the subtask (may beProgressObserver.NO_SUBTASK) (initially useProgressObserver.registerSubtask(String)for registering a sub task)max- the intended maximum steps of the subtask
-
notifyProgress
public void notifyProgress(ProgressObserver.ITask task, ProgressObserver.ISubtask subtask, int step, int max) Description copied from class:ProgressObserverNotifies about processing a task or a subtask.- Specified by:
notifyProgressin classProgressObserver- Parameters:
task- the identification of the task to notify about (initially useProgressObserver.registerTask(String)for registering a task)subtask- the identification of the subtask (may beProgressObserver.NO_SUBTASK, initially useProgressObserver.registerSubtask(String)for registering a sub task)step- the current step in 0<=step<=maxmax- the maximum number of steps, ignored if negative and value from start notification is used instead
-
notifyEnd
Description copied from class:ProgressObserverNotifies about ending a (sub)task. Subtask notifications shall occur before task notifications, i.e. correctly nested. Use the identifications returned byProgressObserver.registerTask(String)andProgressObserver.registerSubtask(String). This method shall implicitly unregister the given task and/or subtask.- Specified by:
notifyEndin classProgressObserver- Parameters:
task- the identification of the task which ends (initially useProgressObserver.registerTask(String)for registering a task)subtask- the identification of the subtask withtask(may beProgressObserver.NO_SUBTASK, if given, only the subtask is supposed to end, initially useProgressObserver.registerSubtask(String)for registering a sub task)
-