|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.knowgate.misc.StringHeap
This class is a simple heap structure for sorting Strings lexicographically. It is mainly used in WebMail for generating a sorted output of Hashkeys.
| Field Summary | |
(package private) java.lang.String[] |
keys
|
(package private) int |
num_entries
|
| Constructor Summary | |
StringHeap(int capacity)
|
|
| Method Summary | |
protected void |
decrease(int cur_pos)
Lower an element in the heap structure Note that the cur_pos is actually one larger than the position in the array! |
protected void |
increase(int cur_pos)
Lift an element in the heap structure Note that the cur_pos is actually one larger than the position in the array! |
void |
insert(java.lang.String key)
Insert a key/value pair Reorganize Heap afterwards |
boolean |
isEmpty()
|
java.lang.String |
next()
Return and delete the key with the lowest long value. |
void |
remove(java.lang.String key)
Remove an Object from the Heap. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
int num_entries
java.lang.String[] keys
| Constructor Detail |
public StringHeap(int capacity)
| Method Detail |
public void insert(java.lang.String key)
public java.lang.String next()
public boolean isEmpty()
public void remove(java.lang.String key)
key - The key to remove from the heapprotected void increase(int cur_pos)
protected void decrease(int cur_pos)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||