Class AnyNotNullSharedFutureTaskBase<V>

  • All Implemented Interfaces:
    java.lang.Runnable, java.util.concurrent.Future<V>, java.util.concurrent.RunnableFuture<V>

    public abstract class AnyNotNullSharedFutureTaskBase<V>
    extends java.lang.Object
    implements java.util.concurrent.RunnableFuture<V>
    Created by kurila on 15.09.16.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AnyNotNullSharedFutureTaskBase​(java.util.concurrent.atomic.AtomicReference<V> resultRef, java.util.concurrent.CountDownLatch sharedLatch)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel​(boolean mayInterruptIfRunning)  
      V get()  
      V get​(long timeout, java.util.concurrent.TimeUnit unit)  
      boolean isCancelled()  
      boolean isDone()  
      protected boolean set​(V v)  
      protected boolean setException​(java.lang.Throwable cause)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.RunnableFuture

        run
    • Constructor Detail

      • AnyNotNullSharedFutureTaskBase

        protected AnyNotNullSharedFutureTaskBase​(java.util.concurrent.atomic.AtomicReference<V> resultRef,
                                                 java.util.concurrent.CountDownLatch sharedLatch)
    • Method Detail

      • isDone

        public final boolean isDone()
        Specified by:
        isDone in interface java.util.concurrent.Future<V>
      • get

        public final V get()
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException
        Specified by:
        get in interface java.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
      • get

        public final V get​(long timeout,
                           java.util.concurrent.TimeUnit unit)
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException,
                           java.util.concurrent.TimeoutException
        Specified by:
        get in interface java.util.concurrent.Future<V>
        Throws:
        java.lang.InterruptedException
        java.util.concurrent.ExecutionException
        java.util.concurrent.TimeoutException
      • set

        protected boolean set​(V v)
      • setException

        protected boolean setException​(java.lang.Throwable cause)
      • cancel

        public boolean cancel​(boolean mayInterruptIfRunning)
        Specified by:
        cancel in interface java.util.concurrent.Future<V>
      • isCancelled

        public boolean isCancelled()
        Specified by:
        isCancelled in interface java.util.concurrent.Future<V>