|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.knowgate.cache.ExpireableCache.MyHeap
protected class ExpireableCache.MyHeap
Implement a simple heap that just returns the smallest long variable/Object key pair.
| 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.Object key,
long value)
Insert a key/value pair Reorganize Heap afterwards |
java.lang.Object |
next()
Return and delete the key with the lowest long value. |
long |
peek()
Return timestamp with the lowest value. |
void |
remove(java.lang.Object key)
Remove an Object from the Heap. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int size()
public void insert(java.lang.Object key,
long value)
public long peek()
throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object next()
throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsExceptionpublic void remove(java.lang.Object 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 | ||||||||