org.ws4d.java.structures
Class WaitingQueue

java.lang.Object
  extended by org.ws4d.java.structures.Queue
      extended by org.ws4d.java.structures.WaitingQueue

public class WaitingQueue
extends Queue

Synchronized Queue. The enqueueing thread must wait, until someone takes the object out of the queue.


Constructor Summary
WaitingQueue()
           
 
Method Summary
 void clear()
          Removes all entries from this queue and notifies all waiting thread.
 Iterator iterator()
          Returns an iterator for this queue.
 
Methods inherited from class org.ws4d.java.structures.Queue
checkFirst, enqueue, enqueueAtBeginning, get, isEmpty, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaitingQueue

public WaitingQueue()
Method Detail

iterator

public Iterator iterator()
Returns an iterator for this queue.

This iterator allows to access every item inside this queue. If an element is removed using this iterator the waiting thread will be notified.

Overrides:
iterator in class Queue
Returns:
the iterator for this queue.

clear

public void clear()
Removes all entries from this queue and notifies all waiting thread.

Overrides:
clear in class Queue