FutureTask

constructor(callable: Callable<V>)

Creates a FutureTask that will, upon running, execute the given Callable.

Parameters

callable

the callable task

Throws

if the callable is null


constructor(runnable: Runnable, result: V?)

Creates a FutureTask that will, upon running, execute the given Runnable, and arrange that get will return the given result on successful completion.

Parameters

runnable

the runnable task

result

the result to return on successful completion. If you don't need a particular result, consider using constructions of the form: Future<> f = new FutureTask<Void>(runnable, null)

Throws

if the runnable is null