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.
|
maxsizeIN_TIES, index, NO_VALUEcomparator, 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.
|
getMaxSizeadd, heapifyDown, heapifyUp, removeAt, removeObject, replaceTopElementcheckHeap, heapModified, isEmpty, resize, unorderedIterprivate 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()
Heappublic void clear()
Heapclear in class UpdatableHeap<E>public void offerAt(int pos,
E e)
UpdatableHeapofferAt in class TopBoundedUpdatableHeap<E>pos - Positione - Elementpublic E poll()
Heappoll in class UpdatableHeap<E>protected void handleOverflow(E e)
TopBoundedUpdatableHeaphandleOverflow in class TopBoundedUpdatableHeap<E>e - Overflowing element.Copyright © 2019 ELKI Development Team. License information.