ScheduledFuture
interface ScheduledFuture<V : Any!> : Delayed, Future<V>
A delayed result-bearing action that can be cancelled. Usually a scheduled future is the result of scheduling a task with a ScheduledExecutorService
.
Summary
Inherited functions |
From class Future
Boolean |
cancel(mayInterruptIfRunning: Boolean)
Attempts to cancel execution of this task. This method has no effect if the task is already completed or cancelled, or could not be cancelled for some other reason. Otherwise, if this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task (when known by the implementation) is interrupted in an attempt to stop the task.
The return value from this method does not necessarily indicate whether the task is now cancelled; use isCancelled .
|
V |
get()
Waits if necessary for the computation to complete, and then retrieves its result.
|
V |
get(timeout: Long, unit: TimeUnit!)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
|
Boolean |
isCancelled()
Returns true if this task was cancelled before it completed normally.
|
Boolean |
isDone()
Returns true if this task completed. Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true .
|
|
|