de.lmu.ifi.dbs.elki.utilities.datastructures.heap
Class TiedTopBoundedHeap<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
de.lmu.ifi.dbs.elki.utilities.datastructures.heap.Heap<E>
de.lmu.ifi.dbs.elki.utilities.datastructures.heap.TopBoundedHeap<E>
de.lmu.ifi.dbs.elki.utilities.datastructures.heap.TiedTopBoundedHeap<E>
- Type Parameters:
E
- Object type
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, Queue<E>
- Direct Known Subclasses:
- KNNHeap
public class TiedTopBoundedHeap<E>
- extends TopBoundedHeap<E>
A size-limited heap similar to TopBoundedHeap
, discarding elements with
the highest value. However, this variation keeps a list of tied elements.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class de.lmu.ifi.dbs.elki.utilities.datastructures.heap.Heap |
Heap.Itr |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.datastructures.heap.Heap |
modCount, size |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.datastructures.heap.Heap |
castQueueElement, compare, compareExternal, compareExternalExternal, heapifyDown, heapifyUp, heapifyUpParent, putInQueue, removeAt, swap, toSortedArrayList |
serialVersionUID
private static final long serialVersionUID
- Serial version
- See Also:
- Constant Field Values
ties
private LinkedList<E> ties
- List to keep ties in.
TiedTopBoundedHeap
public TiedTopBoundedHeap(int maxsize,
Comparator<? super E> comparator)
- Constructor with comparator.
- Parameters:
maxsize
- Maximum size of heap (unless tied)comparator
- Comparator
TiedTopBoundedHeap
public TiedTopBoundedHeap(int maxsize)
- Constructor for Comparable objects.
- Parameters:
maxsize
- Maximum size of heap (unless tied)
size
public int size()
- Specified by:
size
in interface Collection<E>
- Overrides:
size
in class Heap<E>
clear
public void clear()
- Specified by:
clear
in interface Collection<E>
- Overrides:
clear
in class Heap<E>
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<E>
- Overrides:
contains
in class Heap<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator
in interface Iterable<E>
- Specified by:
iterator
in interface Collection<E>
- Overrides:
iterator
in class Heap<E>
peek
public E peek()
- Specified by:
peek
in interface Queue<E>
- Overrides:
peek
in class Heap<E>
poll
public E poll()
- Specified by:
poll
in interface Queue<E>
- Overrides:
poll
in class Heap<E>
handleOverflow
protected void handleOverflow(E e)
- Description copied from class:
TopBoundedHeap
- Handle an overflow in the structure.
This function can be overridden to get overflow treatment.
- Overrides:
handleOverflow
in class TopBoundedHeap<E>
- Parameters:
e
- Overflowing element.