Package nzilbb.util
Interface MonitorableTask
-
- All Known Subinterfaces:
MonitorableSeries<T>
- All Known Implementing Classes:
Annotator,MinimalExample,TheWorksExample,Transcriber
public interface MonitorableTaskA task whose progress can be monitored, and which can be cancelled.- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcancel()Cancels the task.IntegergetPercentComplete()Determines how far through the task is is.booleangetRunning()Reveals whether the task is still running or not.default StringgetStatus()Reveals the current status of the task.default StringgetTaskId()Returns a unique identifier for the task.
-
-
-
Method Detail
-
getPercentComplete
Integer getPercentComplete()
Determines how far through the task is is.- Returns:
- An integer between 0 and 100 (inclusive), or null if progress can not be calculated.
-
cancel
void cancel()
Cancels the task.
-
getRunning
boolean getRunning()
Reveals whether the task is still running or not.- Returns:
- true if the task is currently running, false otherwise.
-
getTaskId
default String getTaskId()
Returns a unique identifier for the task.The default implementation returns the ID of the current thread.
- Returns:
- A unique identifier.
-
getStatus
default String getStatus()
Reveals the current status of the task.The default implementation always returns an empty string.
- Returns:
- A description of the current status of the task for displaying to the user, or an empty string.
-
-