net.sf.zig_project.gpl.common.queue
Class GenericPriorityQueue
java.lang.Object
net.sf.zig_project.gpl.common.queue.PriorityQueueBase
net.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
Method Summary |
void |
add(Object o,
int priority)
Adds an element to the queue at the specified priority. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericPriorityQueue
public GenericPriorityQueue(GenericQueue[] qs)
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 queuepriority
- the priority to assign to the element
- Throws:
IndexOutOfBoundsException
- if the priority is not within the
valid range supported by this queue