|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.zig_project.gpl.common.queue.PriorityQueueBase
Base implementation for a Priority Queue. A priority queue consists of elements being associated with a priority as they are queued. Hence, higher priority elements will be dequeued before lower priority elements, regardless of the order in which they were queued. Since this implementation of priority queue consists of a set of queues, elements with the same priority will be ordered by the queue associated with that specific priority. The lowest priority in a priority queue is always 0.
Nested Class Summary | |
protected class |
PriorityQueueBase.QueueSequencer
Provides an Enumeration of the internal queues within the priority queue. |
Field Summary | |
protected OrderedQueue[] |
queues
|
Constructor Summary | |
PriorityQueueBase(OrderedQueue[] qs)
Creates a Priority Queue out of the array of OrderedQueues. |
Method Summary | |
void |
clear()
Empties the Queue. |
boolean |
contains(Object o)
Determines if the Queue contains a copy of the specified Object. |
Enumeration |
elements()
Retrieves a list of the elements currently in the queue in a form suitable to enumerate over. |
int |
getMaxPriority()
Determines the maximum priority at which an element can be queued for this queue. |
boolean |
isEmpty()
Determines if the Queue is empty. |
Object |
peekNext()
Retrieves the next Object from the queue without removing it. |
Object |
remove(Object o)
Removes the first found element that is equal to o from the queue. |
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 |
Field Detail |
protected final OrderedQueue[] queues
Constructor Detail |
public PriorityQueueBase(OrderedQueue[] qs)
Method Detail |
public void clear()
Queue
clear
in interface Queue
public boolean contains(Object o)
Queue
contains
in interface Queue
o
- an Object to look for copies of
public boolean isEmpty()
Queue
isEmpty
in interface Queue
public Object remove(Object o)
Queue
remove
in interface Queue
o
- a copy of the Object to be removed
public Object peekNext()
OrderedBlockingQueue
peekNext
in interface OrderedBlockingQueue
public int getMaxPriority()
public Enumeration elements()
Queue
elements
in interface Queue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |