|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--xxl.collections.AbstractQueue
|
+--xxl.collections.Heap
|
+--xxl.collections.DynamicHeap
The DynamicHeap uses the ArrayResizer to increase or reduce the size of the array dynamically. This means that it is not necessary to know the maximum size of this heap in advance.
ArrayResizer| Field Summary | |
static Function |
FACTORY_METHOD
A factory method to create a new DynamicHeap. |
protected ArrayResizer |
resizer
The ArrayResizer used for resize-operations of the array. |
| Fields inherited from class xxl.collections.Heap |
array,
comparator,
FACTORY_METHOD,
last |
| Fields inherited from class xxl.collections.AbstractQueue |
FACTORY_METHOD |
| Constructor Summary | |
DynamicHeap()
Creates a new DynamicHeap. |
|
DynamicHeap(ArrayResizer resizer)
Creates a new DynamicHeap. |
|
DynamicHeap(java.util.Comparator comparator)
Creates a new DynamicHeap. |
|
DynamicHeap(java.util.Comparator comparator,
ArrayResizer resizer)
Creates a new DynamicHeap. |
|
DynamicHeap(java.util.Iterator iterator)
|
|
DynamicHeap(java.util.Iterator iterator,
java.util.Comparator comparator)
|
|
DynamicHeap(java.lang.Object[] array)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
ArrayResizer resizer)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
java.util.Comparator comparator)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
java.util.Comparator comparator,
ArrayResizer resizer)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
int size)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
int size,
ArrayResizer resizer)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
int size,
java.util.Comparator comparator)
Creates a new DynamicHeap. |
|
DynamicHeap(java.lang.Object[] array,
int size,
java.util.Comparator comparator,
ArrayResizer resizer)
Creates a new DynamicHeap. |
|
| Method Summary | |
void |
clear()
Removes all elements from the heap. |
void |
insert(java.lang.Object object)
Inserts an Object into the heap. |
void |
insertAll(java.util.Iterator objects)
Inserts all elements of a given Iterator into the heap. |
java.lang.Object |
next()
Returns the next element in the iteration. |
| Methods inherited from class xxl.collections.Heap |
bubbleUp,
heapify,
peek,
replace,
sinkIn,
size,
supportsPeek |
| Methods inherited from class xxl.collections.AbstractQueue |
close,
hasNext,
remove,
replaceAll |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final Function FACTORY_METHOD
protected ArrayResizer resizer
| Constructor Detail |
public DynamicHeap(java.lang.Object[] array,
int size,
java.util.Comparator comparator,
ArrayResizer resizer)
array - the array for which the heap is to be createdsize - the size of the heapcomparator - the Comparator used to compare elements in the heapresizer - the ArrayResizer used for resize-operations of the arraypublic DynamicHeap()
public DynamicHeap(java.util.Iterator iterator)
public DynamicHeap(ArrayResizer resizer)
resizer - the ArrayResizer used for resize-operations of the arraypublic DynamicHeap(java.util.Comparator comparator)
comparator - the Comparator used to compare elements in the heap
public DynamicHeap(java.util.Iterator iterator,
java.util.Comparator comparator)
public DynamicHeap(java.lang.Object[] array)
array - the array for which the heap is to be created
public DynamicHeap(java.util.Comparator comparator,
ArrayResizer resizer)
comparator - the Comparator used to compare elements in the heapresizer - the ArrayResizer used for resize-operations of the array
public DynamicHeap(java.lang.Object[] array,
ArrayResizer resizer)
array - the array for which the heap is to be createdresizer - the ArrayResizer used for resize-operations of the array
public DynamicHeap(java.lang.Object[] array,
java.util.Comparator comparator)
array - the array for which the heap is to be createdcomparator - the Comparator used to compare elements in the heap
public DynamicHeap(java.lang.Object[] array,
java.util.Comparator comparator,
ArrayResizer resizer)
array - the array for which the heap is to be createdcomparator - the Comparator used to compare elements in the heapresizer - the ArrayResizer used for resize-operations of the array
public DynamicHeap(java.lang.Object[] array,
int size)
array - the array for which the heap is to be createdsize - the size of the heap
public DynamicHeap(java.lang.Object[] array,
int size,
ArrayResizer resizer)
array - the array for which the heap is to be createdsize - the size of the heapresizer - the ArrayResizer used for resize-operations of the array
public DynamicHeap(java.lang.Object[] array,
int size,
java.util.Comparator comparator)
array - the array for which the heap is to be createdsize - the size of the heapcomparator - the Comparator used to compare elements in the heap| Method Detail |
public void clear()
public void insert(java.lang.Object object)
public void insertAll(java.util.Iterator objects)
objects - an Iterator of Objects
public java.lang.Object next()
throws java.util.NoSuchElementException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||