Package nzilbb.util
Interface MonitorableTask
-
- All Known Subinterfaces:
MonitorableSeries<T>
- All Known Implementing Classes:
Annotator
,MinimalExample
,TheWorksExample
,Transcriber
public interface MonitorableTask
A 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 void
cancel()
Cancels the task.Integer
getPercentComplete()
Determines how far through the task is is.boolean
getRunning()
Reveals whether the task is still running or not.default String
getStatus()
Reveals the current status of the task.default String
getTaskId()
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.
-
-