net.sf.zig_project.gpl.common.queue
Class GenericPriorityQueue

java.lang.Object
  extended bynet.sf.zig_project.gpl.common.queue.PriorityQueueBase
      extended bynet.sf.zig_project.gpl.common.queue.GenericPriorityQueue
All Implemented Interfaces:
OrderedBlockingQueue, Queue
Direct Known Subclasses:
PriorityQueue

public abstract class GenericPriorityQueue
extends PriorityQueueBase

Priority Queue supporting generic elements. The only additional requirement for adding an object is the priority at which to queue it. When using a GenericPriorityQueue, once constructed, only the PriorityQueue should be used to manage the underlying queues. In future releases, updating the contents of one of the underlying queues without using the methods provided by GenericPriorityQueue may result in surprising results.

Version:
January 20, 2005
Author:
Frank Ziglar

Nested Class Summary
 
Nested classes inherited from class net.sf.zig_project.gpl.common.queue.PriorityQueueBase
PriorityQueueBase.QueueSequencer
 
Field Summary
 
Fields inherited from class net.sf.zig_project.gpl.common.queue.PriorityQueueBase
queues
 
Constructor Summary
GenericPriorityQueue(GenericQueue[] qs)
           
 
Method Summary
 void add(Object o, int priority)
          Adds an element to the queue at the specified priority.
 
Methods inherited from class net.sf.zig_project.gpl.common.queue.PriorityQueueBase
clear, contains, elements, getMaxPriority, isEmpty, peekNext, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.zig_project.gpl.common.queue.OrderedBlockingQueue
removeNext
 

Constructor Detail

GenericPriorityQueue

public GenericPriorityQueue(GenericQueue[] qs)
Method Detail

add

public void add(Object o,
                int priority)
Adds an element to the queue at the specified priority.

Parameters:
o - the element to add to the queue
priority - the priority to assign to the element
Throws:
IndexOutOfBoundsException - if the priority is not within the valid range supported by this queue