Package opennlp.tools.util
Class TreeHeap<E>
- java.lang.Object
-
- opennlp.tools.util.TreeHeap<E>
-
- All Implemented Interfaces:
Heap<E>
@Deprecated public class TreeHeap<E> extends java.lang.Object implements Heap<E>
Deprecated.not used anymore, when there is need for a heap use ListHeap insteadAn implementation of the Heap interface based onSortedSet
. This implementation will not allow multiple objects which are equal to be added to the heap. Only use this implementation when object in the heap can be totally ordered (no duplicates).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(E o)
Deprecated.Adds the specified object to the heap.void
clear()
Deprecated.Clears the contents of the heap.E
extract()
Deprecated.Removes the smallest element from the heap and returns it.E
first()
Deprecated.Returns the smallest element of the heap.boolean
isEmpty()
Deprecated.Returns whether the heap is empty.java.util.Iterator<E>
iterator()
Deprecated.Returns an iterator over the elements of the heap.E
last()
Deprecated.Returns the largest element of the heap.static void
main(java.lang.String[] args)
Deprecated.int
size()
Deprecated.Returns the size of the heap.
-
-
-
Method Detail
-
extract
public E extract()
Deprecated.Description copied from interface:Heap
Removes the smallest element from the heap and returns it.
-
first
public E first()
Deprecated.Description copied from interface:Heap
Returns the smallest element of the heap.
-
last
public E last()
Deprecated.Description copied from interface:Heap
Returns the largest element of the heap.
-
iterator
public java.util.Iterator<E> iterator()
Deprecated.Description copied from interface:Heap
Returns an iterator over the elements of the heap. No specific ordering of these elements is guaranteed.
-
add
public void add(E o)
Deprecated.Description copied from interface:Heap
Adds the specified object to the heap.
-
size
public int size()
Deprecated.Description copied from interface:Heap
Returns the size of the heap.
-
clear
public void clear()
Deprecated.Description copied from interface:Heap
Clears the contents of the heap.
-
isEmpty
public boolean isEmpty()
Deprecated.Description copied from interface:Heap
Returns whether the heap is empty.
-
main
public static void main(java.lang.String[] args)
Deprecated.
-
-