org.egothor.util
Class LinkedQueue<T>

java.lang.Object
  extended by org.egothor.util.LinkedQueue<T>

public final class LinkedQueue<T>
extends java.lang.Object

Fully synchronized linked list (in both directions). After each removal, notify() of this object is invoked.

Author:
Leo Galambos

Nested Class Summary
static class LinkedQueue.Entry<T>
           
 
Field Summary
 LinkedQueue.Entry<T> first
           
 LinkedQueue.Entry<T> last
           
 
Constructor Summary
LinkedQueue(int planned_size)
           
 
Method Summary
 LinkedQueue.Entry<T> addFirst(T a)
           
 LinkedQueue.Entry<T> addLast(T a)
           
 LinkedQueue.Entry<T> makeFirst(LinkedQueue.Entry<T> item)
           
 T remove(LinkedQueue.Entry<T> item)
           
 void removeAllAfter(LinkedQueue.Entry<T> item)
           
 int size()
           
 void waitForEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

public LinkedQueue.Entry<T> first

last

public LinkedQueue.Entry<T> last
Constructor Detail

LinkedQueue

public LinkedQueue(int planned_size)
Method Detail

size

public int size()

waitForEmpty

public void waitForEmpty()

addLast

public LinkedQueue.Entry<T> addLast(T a)

addFirst

public LinkedQueue.Entry<T> addFirst(T a)

remove

public T remove(LinkedQueue.Entry<T> item)

removeAllAfter

public void removeAllAfter(LinkedQueue.Entry<T> item)

makeFirst

public LinkedQueue.Entry<T> makeFirst(LinkedQueue.Entry<T> item)