|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MaxPriorityQueue
maintains a Collection
of
Object
s, each with an associated priority.
Implementations should make the peekMax
and
removeMax
operations efficient. Implementations
need not implement the Object-addition operations of the
Collection
interface, since they do not associate each
added Object
with a priority.
Method Summary | |
Object |
deleteMax()
Returns and removes the Object in
this with the highest priority. |
void |
insert(Object item,
int priority)
Inserts item into this, assigning it priority
priority . |
Object |
peekMax()
Returns the Object in this with the
highest priority. |
Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
public void insert(Object item, int priority)
item
into this, assigning it priority
priority
.
item
- Object
being insertedpriority
- Priority of item
public Object peekMax()
Object
in this
with the
highest priority.
public Object deleteMax()
Object
in
this
with the highest priority.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |