de.tub.citydb.api.concurrent
Class WorkerPool.WorkQueue<E>

java.lang.Object
  extended by de.tub.citydb.api.concurrent.WorkerPool.WorkQueue<E>
Enclosing class:
WorkerPool<T>

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


Constructor Summary
WorkerPool.WorkQueue(int capacity)
           
WorkerPool.WorkQueue(int capacity, boolean fair)
           
 
Method Summary
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerPool.WorkQueue

public WorkerPool.WorkQueue(int capacity)

WorkerPool.WorkQueue

public WorkerPool.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)