com.flat502.rox.utils
Class BlockingQueue

java.lang.Object
  extended by com.flat502.rox.utils.BlockingQueue

public class BlockingQueue
extends java.lang.Object

This class provides a simple implementation of the core functionality of Java 1.5's BlockingQueue interface.

The intention is to be able to use this project on Java 1.4.


Constructor Summary
BlockingQueue()
           
 
Method Summary
 void add(java.lang.Object o)
          Adds the specified element to this queue
 java.lang.Object take()
          Retrieves and removes the head of this queue, waiting if no elements are present on this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingQueue

public BlockingQueue()
Method Detail

add

public void add(java.lang.Object o)
Adds the specified element to this queue

Parameters:
o - the element
Throws:
java.lang.NullPointerException - if the specified element is null

take

public java.lang.Object take()
                      throws java.lang.InterruptedException
Retrieves and removes the head of this queue, waiting if no elements are present on this queue.

Returns:
the head of this queue
Throws:
java.lang.InterruptedException - if interrupted while waiting.