Class FairBlockingQueue.ExchangeCountDownLatch<T>

  • Type Parameters:
    T - the type of the item to exchange
    Enclosing class:
    FairBlockingQueue<E>

    protected class FairBlockingQueue.ExchangeCountDownLatch<T>
    extends java.util.concurrent.CountDownLatch
    A count down latch that can be used to exchange information.
    • Constructor Detail

      • ExchangeCountDownLatch

        public ExchangeCountDownLatch​(int i)
        Creates a new ExchangeCountDownLatch with the given count.
        Parameters:
        i - the count
    • Method Detail

      • getItem

        public T getItem()
        Returns the exchanged item.
        Returns:
        the item
      • setItem

        public void setItem​(T item)
        Sets the item to be exchanged.
        Parameters:
        item - the item
      • getFuture

        public FairBlockingQueue.ItemFuture<T> getFuture()
        Returns the future the exchanged item is meant for.
        Returns:
        the future of an asynchronous poll, or null
      • setFuture

        public void setFuture​(FairBlockingQueue.ItemFuture<T> future)
        Sets the future the exchanged item is meant for.
        Parameters:
        future - the future of an asynchronous poll