|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Heap<T>
Declares an interface for heap (and heap alike) structures, handling a given type T
Method Summary | |
---|---|
T |
add(T frn)
Add a new value to the heap, return the new top(). |
void |
clear()
Clear the heap |
T |
insertWithOverflow(T value)
Insert a new value, returning the overflowen object NOTE: This method should not be called after invoking pop() |
T |
pop()
Get and remove the top of the Heap NOTE: Once pop() is called no other add(Object) or
insertWithOverflow(Object) should be called. |
int |
size()
Return the amount of objects currently in the heap |
T |
top()
Get (But not remove) the top of the Heap |
Method Detail |
---|
T pop()
pop()
is called no other add(Object)
or
insertWithOverflow(Object)
should be called.
T top()
T insertWithOverflow(T value)
pop()
T add(T frn)
null
should be returned. pop()
void clear()
int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |