Class CompleteFuture<V>

    • Constructor Detail

      • CompleteFuture

        public CompleteFuture()
    • Method Detail

      • addListener

        public Future<V> addListener​(FutureListener<? extends Future<? super V>> listener)
        Description copied from interface: Future
        Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.
      • removeListener

        public Future<V> removeListener​(FutureListener<? extends Future<? super V>> listener)
        Description copied from interface: Future
        Removes the first occurrence of the specified listener from this future. The specified listener is no longer notified when this future is done. If the specified listener is not associated with this future, this method does nothing and returns silently.
      • await

        public boolean await​(long timeout,
                             TimeUnit unit)
                      throws InterruptedException
        Description copied from interface: Future
        Waits for this future to be completed within the specified time limit.
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        InterruptedException - if the current thread was interrupted
      • isCancelled

        public boolean isCancelled()
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
      • isDone

        public boolean isDone()