|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.util.TreeHeap<E>
@Deprecated public class TreeHeap<E>
An implementation of the Heap interface based on SortedSet
.
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).
Constructor Summary | |
---|---|
TreeHeap()
Deprecated. Creates a new tree heap. |
|
TreeHeap(int size)
Deprecated. Creates a new tree heap of the specified size. |
Method Summary | |
---|---|
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. |
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(String[] args)
Deprecated. |
int |
size()
Deprecated. Returns the size of the heap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeHeap()
public TreeHeap(int size)
size
- The size of the new tree heap.Method Detail |
---|
public E extract()
Heap
extract
in interface Heap<E>
public E first()
Heap
first
in interface Heap<E>
public E last()
Heap
last
in interface Heap<E>
public Iterator<E> iterator()
Heap
iterator
in interface Heap<E>
public void add(E o)
Heap
add
in interface Heap<E>
o
- The object to add to the heap.public int size()
Heap
size
in interface Heap<E>
public void clear()
Heap
clear
in interface Heap<E>
public boolean isEmpty()
Heap
isEmpty
in interface Heap<E>
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |