|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphylonet.heaps.MaxHeap<N,D>
N - is the type of number that is used as the key of the heapD - is the type of object stored in the heap.public abstract class MaxHeap<N extends java.lang.Number,D>
Basic interface for a max heap. The class is iterable. It will retrieve the
objects out of the heap in the order they would be removed via calls to removeMax.
| Constructor Summary | |
|---|---|
MaxHeap()
|
|
| Method Summary | ||
|---|---|---|
abstract D |
getMax()
|
|
static
|
getMaxHeap(int capacity)
|
|
abstract N |
getMaxKey()
|
|
abstract D |
getMin()
|
|
abstract N |
getMinKey()
|
|
abstract void |
insert(N key,
D value)
Insert a new (key,value) pair in to the heap. |
|
abstract boolean |
isEmpty()
|
|
java.util.Iterator<D> |
iterator()
|
|
abstract D |
removeMax()
Remove the maximum (key,value) pair from the heap. |
|
abstract void |
updateMaxKey(N key)
Change the key associated with the object that is currently at the top of the heap. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MaxHeap()
| Method Detail |
|---|
public static <N1 extends java.lang.Number,D1> MaxHeap<N1,D1> getMaxHeap(int capacity)
public abstract N getMinKey()
public abstract D getMin()
public abstract void insert(N key,
D value)
public abstract N getMaxKey()
public abstract D getMax()
public abstract D removeMax()
public abstract boolean isEmpty()
true if this heap contains no data.public abstract void updateMaxKey(N key)
public java.util.Iterator<D> iterator()
iterator in interface java.lang.Iterable<D>next.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||