- java.lang.Object
- 
- org.hsqldb.lib.HsqlArrayHeap<E>
 
- 
- All Implemented Interfaces:
- HsqlHeap<E>
 
 public class HsqlArrayHeap<E> extends java.lang.Object implements HsqlHeap<E> An HsqlHeap implementation backed by an array of objects and anObjectComparator. This implementation is non-blocking, dynamically resizing and thread-safe.- Since:
- 1.7.2
- Author:
- Campbell Burnet (campbell-burnet@users dot sourceforge.net)
 
- 
- 
Constructor SummaryConstructors Constructor Description HsqlArrayHeap(int capacity, java.util.Comparator<E> comparator)Creates a new HsqlArrayHeap with the given initial capacity, using the specified ObjectComparator to maintain the heap invariant.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E o)Adds the specified element to this Heap.voidclear()Removes all elements from this Heap.booleanisEmpty()Retrieves whether this Heap is empty.booleanisFull()Retrieves whether this Heap is full.Epeek()Retrieves the least element from this Heap, without removing it.Eremove()Retrieves the least element from this Heap, removing it in the process.intsize()Retrieves the number of elements currently in this Heap.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
HsqlArrayHeappublic HsqlArrayHeap(int capacity, java.util.Comparator<E> comparator) throws java.lang.IllegalArgumentExceptionCreates a new HsqlArrayHeap with the given initial capacity, using the specified ObjectComparator to maintain the heap invariant.- Parameters:
- capacity- int
- comparator- Comparator
- Throws:
- java.lang.IllegalArgumentException- if capacity less or equal to zero or comparator is null
 
 
- 
 - 
Method Detail- 
clearpublic void clear() Description copied from interface:HsqlHeapRemoves all elements from this Heap.
 - 
addpublic boolean add(E o) Description copied from interface:HsqlHeapAdds the specified element to this Heap.
 - 
isEmptypublic boolean isEmpty() Description copied from interface:HsqlHeapRetrieves whether this Heap is empty.
 - 
isFullpublic boolean isFull() Description copied from interface:HsqlHeapRetrieves whether this Heap is full.
 - 
peekpublic E peek() Description copied from interface:HsqlHeapRetrieves the least element from this Heap, without removing it.
 - 
removepublic E remove() Description copied from interface:HsqlHeapRetrieves the least element from this Heap, removing it in the process.
 - 
sizepublic int size() Description copied from interface:HsqlHeapRetrieves the number of elements currently in this Heap.
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-