E
- Object typepublic class TiedTopBoundedUpdatableHeap<E> extends TopBoundedUpdatableHeap<E>
TopBoundedHeap
, discarding elements
with the highest value. However, this variation keeps a list of tied
elements.Heap.UnorderedIter
Modifier and Type | Field and Description |
---|---|
private java.util.List<E> |
ties
List to keep ties in.
|
maxsize
IN_TIES, index, NO_VALUE
comparator, queue, size
Constructor and Description |
---|
TiedTopBoundedUpdatableHeap(int maxsize)
Constructor for Comparable objects.
|
TiedTopBoundedUpdatableHeap(int maxsize,
java.util.Comparator<? super E> comparator)
Constructor with comparator.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the heap.
|
protected void |
handleOverflow(E e)
Handle an overflow in the structure.
|
void |
offerAt(int pos,
E e)
Offer element at the given position.
|
E |
peek()
Peek at the top element.
|
E |
poll()
Remove the top element.
|
int |
size()
Get the heap size.
|
getMaxSize
add, heapifyDown, heapifyUp, removeAt, removeObject, replaceTopElement
checkHeap, heapModified, isEmpty, resize, unorderedIter
private java.util.List<E> ties
public TiedTopBoundedUpdatableHeap(int maxsize, java.util.Comparator<? super E> comparator)
maxsize
- Maximum size of heap (unless tied)comparator
- Comparatorpublic TiedTopBoundedUpdatableHeap(int maxsize)
maxsize
- Maximum size of heap (unless tied)public int size()
Heap
public void clear()
Heap
clear
in class UpdatableHeap<E>
public void offerAt(int pos, E e)
UpdatableHeap
offerAt
in class TopBoundedUpdatableHeap<E>
pos
- Positione
- Elementpublic E poll()
Heap
poll
in class UpdatableHeap<E>
protected void handleOverflow(E e)
TopBoundedUpdatableHeap
handleOverflow
in class TopBoundedUpdatableHeap<E>
e
- Overflowing element.Copyright © 2019 ELKI Development Team. License information.