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 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,
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.
|
compare, getMaxSize
add, heapifyDownComparable, heapifyDownComparator, heapifyUpComparable, heapifyUpComparator, removeAt, removeObject, replaceTopElement
checkHeap, heapifyDown, heapifyUp, heapModified, isEmpty, resize, unorderedIter
public TiedTopBoundedUpdatableHeap(int maxsize, 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 © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.