public class FloatArrayPriorityQueue extends AbstractFloatPriorityQueue
List.indexOf(Object) search.
It is highly suggested to use HeapPriorityQueue otherwise, unless you know why you need this specific implementation| Constructor and Description |
|---|
FloatArrayPriorityQueue()
Default Constructor
|
FloatArrayPriorityQueue(float[] array)
Constructor using a initial array
|
FloatArrayPriorityQueue(float[] array,
FloatComparator comp)
Constructor using a initial array and a custom sorter
|
FloatArrayPriorityQueue(float[] array,
int size)
Constructor using a initial array
|
FloatArrayPriorityQueue(float[] array,
int size,
FloatComparator comp)
Constructor using a initial array and a custom sorter
|
FloatArrayPriorityQueue(FloatCollection c)
Constructor using a Collection
|
FloatArrayPriorityQueue(FloatCollection c,
FloatComparator comp)
Constructor using a Collection and a custom sorter
|
FloatArrayPriorityQueue(FloatComparator comp)
Constructor using custom sorter
|
FloatArrayPriorityQueue(int size)
Constructor with a Min Capacity
|
FloatArrayPriorityQueue(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() |
FloatArrayPriorityQueue |
copy()
A Function that does a shallow clone of the PriorityQueue itself.
|
int |
count(FloatPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
float |
dequeue()
Method to extract a element from the PriorityQueue
|
void |
enqueue(float e)
Method to insert a element into the PriorityQueue
|
float |
findFirst(FloatPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
float |
first()
Shows the element that is to be returned next
|
<E> void |
forEach(E input,
ObjectFloatConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(FloatConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
void |
forEachIndexed(IntFloatConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
FloatIterator |
iterator()
Returns an iterator over elements of type
T. |
boolean |
matchesAll(FloatPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(FloatPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(FloatPredicate filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
float |
peek(int index)
Peeking function to see whats inside the queue.
|
float |
reduce(float identity,
FloatFloatUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
float |
reduce(FloatFloatUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
removeFirst(float e)
Removes the first found element in the queue
|
boolean |
removeLast(float e)
Removes the last found element in the queue
|
int |
size() |
float[] |
toFloatArray(float[] input)
A method to drop the contents of the Queue without clearing the queue
|
static FloatArrayPriorityQueue |
wrap(float[] array)
Wrapping method to help serialization
|
static FloatArrayPriorityQueue |
wrap(float[] array,
FloatComparator comp)
Wrapping method to help serialization, using a custom sorter
|
static FloatArrayPriorityQueue |
wrap(float[] array,
int size)
Wrapping method to help serialization
|
static FloatArrayPriorityQueue |
wrap(float[] array,
int size,
FloatComparator comp)
Wrapping method to help serialization, using a custom sorter
|
equals, hashCode, toStringenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, synchronizeQueue, synchronizeQueue, toFloatArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pour, pourAsList, pourAsSet, repeat, sorted, spliteratorpublic FloatArrayPriorityQueue()
public FloatArrayPriorityQueue(FloatComparator comp)
comp - Comparator to sort the Array. Can be nullpublic FloatArrayPriorityQueue(int size)
size - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public FloatArrayPriorityQueue(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 FloatArrayPriorityQueue(float[] array)
array - the Array that should be usedpublic FloatArrayPriorityQueue(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 FloatArrayPriorityQueue(float[] array,
FloatComparator comp)
array - the Array that should be usedcomp - Comparator to sort the Array. Can be nullpublic FloatArrayPriorityQueue(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 FloatArrayPriorityQueue(FloatCollection c)
c - the Collection that should be usedpublic FloatArrayPriorityQueue(FloatCollection c, FloatComparator comp)
c - the Collection that should be usedcomp - Comparator to sort the Array. Can be nullpublic static FloatArrayPriorityQueue wrap(float[] array)
array - the array that should be usedpublic static FloatArrayPriorityQueue wrap(float[] array, int size)
array - the array that should be usedsize - the amount of elements within the arraypublic static FloatArrayPriorityQueue wrap(float[] array, FloatComparator comp)
array - the array that should be usedcomp - Comparator to sort the Array. Can be nullpublic static FloatArrayPriorityQueue 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 void enqueue(float e)
FloatPriorityQueuee - the element that should be insertedpublic float dequeue()
FloatPriorityQueuepublic float first()
FloatPriorityQueuepublic float peek(int index)
FloatPriorityQueueindex - of the element that is requested to be viewed.public boolean removeFirst(float e)
FloatPriorityQueuee - the element that should be removedpublic boolean removeLast(float e)
FloatPriorityQueuee - the element that should be removedpublic void onChanged()
FloatPriorityQueuepublic int size()
public void clear()
FloatPriorityQueuepublic void forEach(FloatConsumer action)
FloatIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntFloatConsumer action)
FloatIterableaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectFloatConsumer<E> action)
FloatIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(FloatPredicate filter)
FloatIterablefilter - that should be appliedpublic boolean matchesNone(FloatPredicate filter)
FloatIterablefilter - that should be appliedpublic boolean matchesAll(FloatPredicate filter)
FloatIterablefilter - that should be appliedpublic float reduce(float identity,
FloatFloatUnaryOperator operator)
FloatIterableidentity - the start valueoperator - the operation that should be appliedpublic float reduce(FloatFloatUnaryOperator operator)
FloatIterableoperator - the operation that should be appliedpublic float findFirst(FloatPredicate filter)
FloatIterablefilter - that should be appliedpublic int count(FloatPredicate filter)
FloatIterablefilter - that should be appliedpublic FloatIterator iterator()
FloatIterableT.public FloatArrayPriorityQueue copy()
FloatPriorityQueuepublic FloatComparator comparator()
public float[] toFloatArray(float[] input)
FloatPriorityQueueinput - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array