类 ListenableFutureTask<T>

类型参数:
T - the result type returned by this Future's get method
所有已实现的接口:
ListenableFuture<T>, SettableFuture<T>, Runnable, Future<T>, RunnableFuture<T>

public class ListenableFutureTask<T> extends SettableFutureTask<T> implements ListenableFuture<T>
RunnableFuture
从以下版本开始:
4.0
作者:
Arjen Poutsma, Harry Yang
另请参阅:
  • 构造器详细资料

    • ListenableFutureTask

      public ListenableFutureTask(Callable<T> callable)
      Create a new ListenableFutureTask that will, upon running, execute the given Callable.
      参数:
      callable - the callable task
    • ListenableFutureTask

      public ListenableFutureTask(Runnable runnable, @Nullable T result)
      Create a ListenableFutureTask that will, upon running, execute the given Runnable, and arrange that DefaultFuture.get() will return the given result on successful completion.
      参数:
      runnable - the runnable task
      result - the result to return on successful completion