Luky Library - 4.1.1 (20061117-1148)

luky.util
Class BlockingQueue

java.lang.Object
  extended by luky.util.BlockingQueue

public class BlockingQueue
extends Object

BlockingQueue is used to coordinate work between a producer and consumer threads. The producer adds elements to the queue containing information The consumer threads remove objects from the queue, if the queue is empty the thread will block until a new object is added to the queue. Revision Changes :

Version:
1.01
Author:
Chris Lukassen
 

Field Summary
protected  List queue
           
 
Constructor Summary
BlockingQueue()
          default constructor
 
Method Summary
 void add(Object o)
          add an element to the queue
 void addLast(Object o)
          add an element to the queue (equals add, but for left for compatibilty)
 void clearAndAdd(Object o)
          clear the queue and add an element to the queue
 Object get()
          Deprecated. will be replaced by remove in the future, get will become peekFirst!
 Object getFirst()
          Deprecated. will be replaced by remove in the future
 Object peekFirst()
          Peeks a the first element, but leaves it in the queue
 Object remove()
          get the first element from the queue (and remove it from the queue)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected List queue
Constructor Detail

BlockingQueue

public BlockingQueue()
default constructor

Method Detail

clearAndAdd

public void clearAndAdd(Object o)
clear the queue and add an element to the queue


addLast

public void addLast(Object o)
add an element to the queue (equals add, but for left for compatibilty)


add

public void add(Object o)
add an element to the queue


peekFirst

public Object peekFirst()
Peeks a the first element, but leaves it in the queue


getFirst

public Object getFirst()
Deprecated. will be replaced by remove in the future

get the first element from the queue (equals get, but for left for compatibilty)


get

public Object get()
Deprecated. will be replaced by remove in the future, get will become peekFirst!

get an element from the queue (and remove it from the queue)


remove

public Object remove()
get the first element from the queue (and remove it from the queue)


Luky Library - 4.1.1 (20061117-1148)