E
- Object typepublic class TiedTopBoundedHeap<E> extends TopBoundedHeap<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
Constructor and Description |
---|
TiedTopBoundedHeap(int maxsize)
Constructor for Comparable objects.
|
TiedTopBoundedHeap(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() |
E |
peek() |
E |
poll() |
int |
size() |
getMaxSize, offer
add, addAll, castQueueElement, checkHeap, ensureValid, heapifyDown, heapifyDownComparable, heapifyDownComparator, heapifyUp, heapifyUpComparable, heapifyUpComparator, removeAt, 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 TiedTopBoundedHeap(int maxsize, Comparator<? super E> comparator)
maxsize
- Maximum size of heap (unless tied)comparator
- Comparatorpublic TiedTopBoundedHeap(int maxsize)
maxsize
- Maximum size of heap (unless tied)public int size()
public void clear()
public boolean contains(Object o)
protected void handleOverflow(E e)
TopBoundedHeap
handleOverflow
in class TopBoundedHeap<E>
e
- Overflowing element.