Package org.apache.lucene.facet.search
Interface Heap<T>
-
public interface Heap<T>
Declares an interface for heap (and heap alike) structures, handling a given type T- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
add(T frn)
Add a new value to the heap, return the new top().void
clear()
Clear the heapT
insertWithOverflow(T value)
Insert a new value, returning the overflowen object
NOTE: This method should not be called after invokingpop()
T
pop()
Get and remove the top of the Heap
NOTE: Oncepop()
is called no otheradd(Object)
orinsertWithOverflow(Object)
should be called.int
size()
Return the amount of objects currently in the heapT
top()
Get (But not remove) the top of the Heap
-
-
-
Method Detail
-
pop
T pop()
Get and remove the top of the Heap
NOTE: Oncepop()
is called no otheradd(Object)
orinsertWithOverflow(Object)
should be called.
-
top
T top()
Get (But not remove) the top of the Heap
-
insertWithOverflow
T insertWithOverflow(T value)
Insert a new value, returning the overflowen object
NOTE: This method should not be called after invokingpop()
-
add
T add(T frn)
Add a new value to the heap, return the new top().
Some implementations may choose to not implement this functionality. In such a casenull
should be returned.
NOTE: This method should not be called after invokingpop()
-
clear
void clear()
Clear the heap
-
size
int size()
Return the amount of objects currently in the heap
-
-