|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Heap
Interface for interacting with a Heap data structure. This implementation extract objects from smallest to largest based on either their natural ordering or the comparator provided to an implementation. While this is a typical of a heap it allows this objects natural ordering to match that of other sorted collections.
| Method Summary | |
|---|---|
void |
add(java.lang.Object o)
Adds the specified object to the heap. |
void |
clear()
Clears the contents of the heap. |
java.lang.Object |
extract()
Removes the smallest element from the heap and returns it. |
java.lang.Object |
first()
Returns the smallest element of the heap. |
boolean |
isEmpty()
Returns whether the heap is empty. |
java.util.Iterator |
iterator()
Returns an iterator over the elements of the heap. |
java.lang.Object |
last()
Returns the largest element of the heap. |
int |
size()
Returns the size of the heap. |
| Method Detail |
|---|
java.lang.Object extract()
java.lang.Object first()
java.lang.Object last()
void add(java.lang.Object o)
o - The object to add to the heap.int size()
boolean isEmpty()
java.util.Iterator iterator()
void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||