
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, offeradd, addAll, castQueueElement, checkHeap, ensureValid, heapifyDown, heapifyDownComparable, heapifyDownComparator, heapifyUp, heapifyUpComparable, heapifyUpComparator, removeAt, resize, toSortedArrayListelement, removecontainsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArrayprivate 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)
TopBoundedHeaphandleOverflow in class TopBoundedHeap<E>e - Overflowing element.