public interface Task extends Cancelable, Named
Modifier and Type | Method and Description |
---|---|
long |
getProgressMaximum()
Gets the number of steps the task performs in total.
|
long |
getProgressValue()
Gets the step the task is currently performing.
|
String |
getStatusMessage()
Gets a status message describing what the task is currently doing.
|
boolean |
isDone()
Checks whether the task has completed.
|
void |
run(Runnable r)
Starts running the task.
|
void |
setProgressMaximum(long max)
Sets the total number of steps.
|
void |
setProgressValue(long step)
Sets the current step.
|
void |
setStatusMessage(String status)
Sets the status message.
|
void |
waitFor()
Waits for the task to complete.
|
cancel, getCancelReason, isCanceled
void run(Runnable r)
IllegalStateException
- if the task was already started.void waitFor() throws InterruptedException, ExecutionException
IllegalStateException
- if run(java.lang.Runnable)
has not been called yet.InterruptedException
- if the task is interrupted.ExecutionException
- if the task throws an exception while running.boolean isDone()
String getStatusMessage()
long getProgressValue()
getProgressMaximum()
inclusive.getProgressMaximum()
long getProgressMaximum()
getProgressValue()
void setStatusMessage(String status)
status
- The message to set.getStatusMessage()
void setProgressValue(long step)
step
- The step vaule to set.getProgressValue()
void setProgressMaximum(long max)
max
- The step count to set.getProgressMaximum()
Copyright © 2015–2022 SciJava. All rights reserved.