javax.realtime
Class PriorityQueue

java.lang.Object
  extended byjavax.realtime.PriorityQueue

public class PriorityQueue
extends Object

This class represent a priority queue. A priority queues stores element in a order described by their priority. This implementation provides with lock free iterators for browsing the element of the queue. While writes are serialized by a write-lock. This class guarantees that the iterator keep consistent even while element are being added or removed.

Author:
Angelo Corsaro

Nested Class Summary
static class PriorityQueue.ForwardIterator
           
protected static class PriorityQueue.Item
           
protected static class PriorityQueue.PriorityQueueLane
          This class implements a priority lane that is used to group together all the objects that have the same priority.
 
Field Summary
protected  PriorityQueue.PriorityQueueLane queueHead
           
protected  PriorityQueue.PriorityQueueLane queueTail
           
 
Constructor Summary
PriorityQueue()
           
 
Method Summary
 void add(Object object, int priority)
           
 boolean contains(Object object)
           
 PriorityQueue.ForwardIterator iterator()
           
 void iterator(PriorityQueue.ForwardIterator iterator)
           
 void remove(Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueHead

protected PriorityQueue.PriorityQueueLane queueHead

queueTail

protected PriorityQueue.PriorityQueueLane queueTail
Constructor Detail

PriorityQueue

public PriorityQueue()
Method Detail

iterator

public PriorityQueue.ForwardIterator iterator()

iterator

public void iterator(PriorityQueue.ForwardIterator iterator)

add

public void add(Object object,
                int priority)

contains

public boolean contains(Object object)

remove

public void remove(Object object)


jRate is developed and maintained by the jRate project development team.
Copyright (c) 2001-2005 Angelo Corsaro and Morgan Deters.