E
- Element type. Should be Comparable
or a Comparator
needs to be given.public class TopBoundedHeap<E> extends Heap<E>
k
Elements only.Modifier and Type | Field and Description |
---|---|
protected int |
maxsize
Maximum size
|
private static long |
serialVersionUID
Serial version
|
Constructor and Description |
---|
TopBoundedHeap(int maxsize)
Constructor with maximum size only.
|
TopBoundedHeap(int maxsize,
Comparator<? super E> comparator)
Constructor with maximum size and
Comparator . |
Modifier and Type | Method and Description |
---|---|
int |
getMaxSize() |
protected void |
handleOverflow(E e)
Handle an overflow in the structure.
|
boolean |
offer(E e) |
castQueueElement, clear, compare, compareExternal, compareExternalExternal, contains, heapifyDown, heapifyUp, heapifyUpParent, iterator, peek, poll, putInQueue, removeAt, size, swap, toSortedArrayList
add, addAll, 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
protected int maxsize
public TopBoundedHeap(int maxsize)
maxsize
- Maximum sizepublic TopBoundedHeap(int maxsize, Comparator<? super E> comparator)
Comparator
.maxsize
- Maximum sizecomparator
- Comparator