|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Required methods for the Priority Queue ADT.
Method Summary | |
Object |
highest()
Returns an object in this associated with a highest priority key. |
Comparable |
highestKey()
Returns a highest priority key in this. |
void |
insertItem(Comparable key,
Object element)
Associates the given key and object and inserts them into this, increasing its size by 1. |
boolean |
isEmpty()
Returns whether or not this is empty. |
Object |
removeHighest()
Removes and returns the object in this associated with a highest priority key, reducing its size by 1. |
int |
size()
Returns the number of items in this. |
Method Detail |
public void insertItem(Comparable key, Object element)
key
- representation of priority for the elementelement
- object to store in thispublic Object removeHighest()
RuntimeException
- if this is emptypublic Comparable highestKey()
RuntimeException
- if this is emptypublic Object highest()
RuntimeException
- if this is emptypublic int size()
public boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |