|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--morey.spore.Heap
This is an uninspired Heap.
Here is a link to the source code
NoDupsHeap| Field Summary | |
protected java.util.Vector |
data
|
| Constructor Summary | |
Heap()
|
|
Heap(java.util.Enumeration e)
|
|
| Method Summary | |
void |
add(Comparable value)
Add a comparable to the heap |
protected java.util.Enumeration |
elements()
Give out the elements of the Heap |
protected java.lang.Object |
first()
this is like a peek to see the first element. |
protected boolean |
isEmpty()
|
protected static int |
leftChildOf(int i)
calculates the index of the leftChildOf the node at index i |
protected static int |
parentOf(int i)
calculates the index of the parent of the node at index i |
protected void |
percolateUp(int here)
A value has been aded to the last level order position in the heap, destroying the heap property. |
protected void |
pushDown(int here)
A value has been aded to the last level order position in the heap, destroying the heap property. |
void |
rebuild()
|
protected java.lang.Object |
remove()
this is like a peek to see the first element. |
protected void |
remove(java.lang.Object o)
this is like a peek to see the first element. |
protected static int |
rightChildOf(int i)
calculates the index of the rightChildOf the node at index i |
protected int |
size()
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.util.Vector data
| Constructor Detail |
public Heap()
public Heap(java.util.Enumeration e)
| Method Detail |
public void rebuild()
protected static int parentOf(int i)
i - the index of the child of the node we want the index of.protected static int leftChildOf(int i)
i - the index of the parent of the node we want the index of.protected static int rightChildOf(int i)
i - the index of the parent of the node we want the index of.protected boolean isEmpty()
protected int size()
protected java.lang.Object first()
public void add(Comparable value)
value - is to be added to the heapprotected java.lang.Object remove()
protected void remove(java.lang.Object o)
protected void percolateUp(int here)
here - is the new element's indexprotected void pushDown(int here)
here - is the new element's indexprotected java.util.Enumeration elements()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||