Class WorkerPool.WorkQueue<E>

  • Enclosing class:
    WorkerPool<T>

    public static final class WorkerPool.WorkQueue<E>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkQueue​(int capacity)  
      WorkQueue​(int capacity, boolean fair)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      int drainTo​(java.util.Collection<? super E> collection)  
      boolean isEmpty()  
      boolean offer​(E work)  
      boolean offer​(E work, long timeout, java.util.concurrent.TimeUnit unit)  
      E peek()  
      E poll()  
      E poll​(long timeout, java.util.concurrent.TimeUnit unit)  
      void put​(E work)  
      int remainingCapacity()  
      boolean remove​(E work)  
      int size()  
      E take()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkQueue

        public WorkQueue​(int capacity)
      • WorkQueue

        public WorkQueue​(int capacity,
                         boolean fair)
    • Method Detail

      • offer

        public boolean offer​(E work)
      • offer

        public boolean offer​(E work,
                             long timeout,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • put

        public void put​(E work)
      • poll

        public E poll()
      • poll

        public E poll​(long timeout,
                      java.util.concurrent.TimeUnit unit)
               throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • take

        public E take()
               throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • peek

        public E peek()
      • remove

        public boolean remove​(E work)
      • size

        public int size()
      • remainingCapacity

        public int remainingCapacity()
      • isEmpty

        public boolean isEmpty()
      • clear

        public void clear()
      • drainTo

        public int drainTo​(java.util.Collection<? super E> collection)