public class FloatHeapPriorityQueue extends java.lang.Object implements FloatPriorityQueue
| Constructor and Description |
|---|
FloatHeapPriorityQueue()
Default Constructor
|
FloatHeapPriorityQueue(float[] array)
Constructor using a initial array
|
FloatHeapPriorityQueue(float[] array,
FloatComparator comp)
Constructor using a initial array and a custom sorter
|
FloatHeapPriorityQueue(float[] array,
int size)
Constructor using a initial array
|
FloatHeapPriorityQueue(float[] array,
int size,
FloatComparator comp)
Constructor using a initial array and a custom sorter
|
FloatHeapPriorityQueue(FloatCollection c)
Constructor using a Collection
|
FloatHeapPriorityQueue(FloatCollection c,
FloatComparator comp)
Constructor using a Collection and a custom sorter
|
FloatHeapPriorityQueue(FloatComparator comp)
Constructor using custom sorter
|
FloatHeapPriorityQueue(int size)
Constructor with a Min Capacity
|
FloatHeapPriorityQueue(int size,
FloatComparator comp)
Constructor with a Min Capacity and custom Sorter
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
FloatComparator |
comparator() |
float |
dequeueFloat()
Method to extract a element from the PriorityQueue
|
void |
enqueueFloat(float e)
Method to insert a element into the PriorityQueue
|
FloatIterator |
iterator()
Returns an iterator over elements of type
T. |
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
float |
peekFloat(int index)
Peeking function to see whats inside the queue.
|
boolean |
removeFloat(float e)
Removes the first found element in the queue
|
boolean |
removeLastFloat(float e)
Removes the last found element in the queue
|
int |
size() |
java.lang.Float[] |
toArray(java.lang.Float[] input)
A method to drop the contents of the Queue without clearing the queue
|
float[] |
toFloatArray(float[] input)
A method to drop the contents of the Queue without clearing the queue
|
static FloatHeapPriorityQueue |
wrap(float[] array)
Wrapping method to help serialization
|
static FloatHeapPriorityQueue |
wrap(float[] array,
FloatComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static FloatHeapPriorityQueue |
wrap(float[] array,
int size)
Wrapping method to help serialization
|
static FloatHeapPriorityQueue |
wrap(float[] array,
int size,
FloatComparator comp)
Wrapping method to help serialization, using a custom sorter
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeue, enqueue, first, firstFloat, peek, remove, removeLast, toArray, toFloatArrayisEmptyforEach, forEach, spliteratorpublic FloatHeapPriorityQueue()
public FloatHeapPriorityQueue(FloatComparator comp)
comp - Comparator to sort the Array. Can be nullpublic FloatHeapPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public FloatHeapPriorityQueue(int size,
FloatComparator comp)
size - the initial capacity of the backing arraycomp - Comparator to sort the Array. Can be nulljava.lang.IllegalStateException - if the initial size is smaller 0public FloatHeapPriorityQueue(float[] array)
array - the Array that should be usedpublic FloatHeapPriorityQueue(float[] array,
int size)
array - the Array that should be usedsize - the amount of elements found within the arrayjava.lang.NegativeArraySizeException - if size is smaller then 0public FloatHeapPriorityQueue(float[] array,
FloatComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic FloatHeapPriorityQueue(float[] array,
int size,
FloatComparator comp)
array - the Array that should be usedsize - the amount of elements found within the arraycomp - Comparator to sort the Array. Can be nulljava.lang.NegativeArraySizeException - if size is smaller then 0public FloatHeapPriorityQueue(FloatCollection c)
c - the Collection that should be usedpublic FloatHeapPriorityQueue(FloatCollection c, FloatComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static FloatHeapPriorityQueue wrap(float[] array)
array - the array that should be usedpublic static FloatHeapPriorityQueue wrap(float[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static FloatHeapPriorityQueue wrap(float[] array, FloatComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static FloatHeapPriorityQueue wrap(float[] array, int size, FloatComparator comp)
array - the array that should be usedsize - the amount of elements within the arraycomp - Comparator to sort the Array. Can be nullpublic int size()
size in interface ObjectPriorityQueue<java.lang.Float>public void clear()
ObjectPriorityQueueclear in interface ObjectPriorityQueue<java.lang.Float>public FloatIterator iterator()
FloatIterableT.iterator in interface java.lang.Iterable<java.lang.Float>iterator in interface FloatIterablepublic void enqueueFloat(float e)
FloatPriorityQueueenqueueFloat in interface FloatPriorityQueuee - the element that should be insertedpublic float dequeueFloat()
FloatPriorityQueuedequeueFloat in interface FloatPriorityQueuepublic float peekFloat(int index)
FloatPriorityQueuepeekFloat in interface FloatPriorityQueueindex - of the element that is requested to be viewed.public boolean removeFloat(float e)
FloatPriorityQueueremoveFloat in interface FloatPriorityQueuee - the element that should be removedpublic boolean removeLastFloat(float e)
FloatPriorityQueueremoveLastFloat in interface FloatPriorityQueuee - the element that should be removedpublic void onChanged()
FloatPriorityQueueonChanged in interface FloatPriorityQueueonChanged in interface ObjectPriorityQueue<java.lang.Float>public FloatComparator comparator()
comparator in interface FloatPriorityQueuecomparator in interface ObjectPriorityQueue<java.lang.Float>public float[] toFloatArray(float[] input)
FloatPriorityQueuetoFloatArray in interface FloatPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created arraypublic java.lang.Float[] toArray(java.lang.Float[] input)
ObjectPriorityQueuetoArray in interface FloatPriorityQueuetoArray in interface ObjectPriorityQueue<java.lang.Float>input - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array