|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A priority queue applies a comparator so that the remove method dispenses the object that preceed the other objects in the queue when odered with the comparator. Initial condition: this = (); If this = (a0, a1, ..., an-1) then a0 is the front object and an-1 is the rear object. and there is an order relationship "<=" such that ai <= ai+1 for all i, 0<=i<#(L)-2
| Method Summary | |
java.lang.Object |
frontOf()
Method frontOf return front, a0. |
void |
insert(java.lang.Object item)
Method insert item into the PriorityQueue. |
boolean |
isEmpty()
Method isEmpty returns this==(). |
java.lang.Object |
remove()
Method remove the object from the front of the PriorityQueue, a0. |
| Method Detail |
public boolean isEmpty()
public java.lang.Object frontOf()
public void insert(java.lang.Object item)
item - Post: i'=#(this)+1
There is a k such that a'k=item andpublic java.lang.Object remove()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||