public
interface Future<V>
A
Future represents the result of an asynchronous computation. Future
Interface provides methods to check if the computation of task is
complete or not, to wait for task completion, and to retrieve the
result of the computation and to cancel the task.
Method
|
Description
|
boolean
cancel(boolean interrupt)
|
Attempts
to cancel execution of this task.
|
V
get()
|
Waits
if necessary for the computation to complete, and then retrieves
its result.
|
V
get(long timeout, TimeUnit unit)
|
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.
|
Related
Posts
https://self-learning-java-tutorial.blogspot.com/2014/03/isdone-check-completion-status-of-task.html
This comment has been removed by the author.
ReplyDelete