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.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Serial version
|
private List<E> |
ties
List to keep ties in.
|
maxsize
IN_TIES, index, NO_VALUE
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() |
boolean |
contains(Object o) |
protected void |
handleOverflow(E e)
Handle an overflow in the structure.
|
Iterator<E> |
iterator() |
boolean |
offerAt(int pos,
E e) |
E |
peek() |
E |
poll() |
int |
size() |
compare, getMaxSize
heapifyDownComparable, heapifyDownComparator, heapifyUpComparable, heapifyUpComparator, offer, removeAt, removeObject
add, addAll, castQueueElement, checkHeap, ensureValid, heapifyDown, heapifyUp, resize, toSortedArrayList
element, remove
containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
private static final long serialVersionUID
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()
public void clear()
clear
in interface Collection<E>
clear
in class UpdatableHeap<E>
public boolean contains(Object o)
public boolean offerAt(int pos, E e)
offerAt
in class TopBoundedUpdatableHeap<E>
public E poll()
protected void handleOverflow(E e)
TopBoundedUpdatableHeap
handleOverflow
in class TopBoundedUpdatableHeap<E>
e
- Overflowing element.