E
- Element type. Should be Comparable
or a Comparator
needs to be given.public class TopBoundedUpdatableHeap<E> extends UpdatableHeap<E>
k
Elements only.Heap.UnorderedIter
Modifier and Type | Field and Description |
---|---|
protected int |
maxsize
Maximum size.
|
IN_TIES, index, NO_VALUE
comparator, queue, size
Constructor and Description |
---|
TopBoundedUpdatableHeap(int maxsize)
Constructor with maximum size only.
|
TopBoundedUpdatableHeap(int maxsize,
java.util.Comparator<? super E> comparator)
Constructor with maximum size and
Comparator . |
Modifier and Type | Method and Description |
---|---|
int |
getMaxSize()
Get the maximum size.
|
protected void |
handleOverflow(E e)
Handle an overflow in the structure.
|
void |
offerAt(int pos,
E e)
Offer element at the given position.
|
add, clear, heapifyDown, heapifyUp, poll, removeAt, removeObject, replaceTopElement
checkHeap, heapModified, isEmpty, peek, resize, size, unorderedIter
public TopBoundedUpdatableHeap(int maxsize)
maxsize
- Maximum sizepublic TopBoundedUpdatableHeap(int maxsize, java.util.Comparator<? super E> comparator)
Comparator
.maxsize
- Maximum sizecomparator
- Comparatorpublic void offerAt(int pos, E e)
UpdatableHeap
offerAt
in class UpdatableHeap<E>
pos
- Positione
- Elementprotected void handleOverflow(E e)
e
- Overflowing element.public int getMaxSize()
Copyright © 2019 ELKI Development Team. License information.