public class FloatArrayFIFOQueue extends AbstractFloatPriorityQueue implements FloatPriorityDequeue, ITrimmable
| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_CAPACITY
The Minimum Capacity that is allowed
|
| Constructor and Description |
|---|
FloatArrayFIFOQueue()
Default Construtor
|
FloatArrayFIFOQueue(float[] values)
Constructor using a initial array
|
FloatArrayFIFOQueue(float[] values,
int size)
Constructor using a initial array
|
FloatArrayFIFOQueue(float[] values,
int offset,
int size)
Constructor using a initial array
|
FloatArrayFIFOQueue(int capacity)
Constructor with a Min Capacity
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
FloatComparator |
comparator() |
FloatArrayFIFOQueue |
copy()
A Function that does a shallow clone of the PriorityQueue itself.
|
int |
count(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
float |
dequeue()
Method to extract a element from the PriorityQueue
|
float |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(float e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(float e)
Method to insert a element into the first Index instead of the last.
|
float |
findFirst(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
<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
|
FloatIterator |
iterator()
Returns an iterator over elements of type
T. |
boolean |
matchesAll(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Float2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Float2BooleanFunction 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
|
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
equals, hashCode, toStringenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, last, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, first, isEmpty, toFloatArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pour, pourAsList, pourAsSet, sorted, spliteratorclearAndTrim, trimpublic static final int MIN_CAPACITY
public FloatArrayFIFOQueue(float[] values)
values - the Array that should be usedpublic FloatArrayFIFOQueue(float[] values,
int size)
values - the Array that should be usedsize - the amount of elements that are in the initial arrayjava.lang.IllegalStateException - if values is smaller then sizepublic FloatArrayFIFOQueue(float[] values,
int offset,
int size)
values - the Array that should be usedoffset - where to begin in the initial arraysize - the amount of elements that are in the initial arrayjava.lang.IllegalStateException - if values is smaller then sizepublic FloatArrayFIFOQueue(int capacity)
capacity - the initial capacity of the backing arrayjava.lang.IllegalStateException - if the initial size is smaller 0public FloatArrayFIFOQueue()
public FloatIterator iterator()
FloatIterableT.iterator in interface java.lang.Iterable<java.lang.Float>iterator in interface FloatIterablepublic int size()
size in interface FloatPriorityQueuepublic void clear()
FloatPriorityQueueclear in interface FloatPriorityQueuepublic void enqueue(float e)
FloatPriorityQueueenqueue in interface FloatPriorityQueuee - the element that should be insertedpublic void enqueueFirst(float e)
FloatPriorityDequeueenqueueFirst in interface FloatPriorityDequeuee - the element that should be inserted into the first placepublic float dequeue()
FloatPriorityQueuedequeue in interface FloatPriorityQueuepublic float dequeueLast()
FloatPriorityDequeuedequeueLast in interface FloatPriorityDequeuepublic float peek(int index)
FloatPriorityQueuepeek in interface FloatPriorityQueueindex - of the element that is requested to be viewed.public boolean removeFirst(float e)
FloatPriorityQueueremoveFirst in interface FloatPriorityQueuee - the element that should be removedpublic boolean removeLast(float e)
FloatPriorityQueueremoveLast in interface FloatPriorityQueuee - the element that should be removedpublic void onChanged()
FloatPriorityQueueonChanged in interface FloatPriorityQueuepublic FloatArrayFIFOQueue copy()
FloatPriorityQueuecopy in interface FloatPriorityDequeuecopy in interface FloatPriorityQueuepublic FloatComparator comparator()
comparator in interface FloatPriorityQueuepublic void forEach(FloatConsumer action)
FloatIterableforEach in interface FloatIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectFloatConsumer<E> action)
FloatIterableforEach in interface FloatIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Float2BooleanFunction filter)
FloatIterablematchesAny in interface FloatIterablefilter - that should be appliedpublic boolean matchesNone(Float2BooleanFunction filter)
FloatIterablematchesNone in interface FloatIterablefilter - that should be appliedpublic boolean matchesAll(Float2BooleanFunction filter)
FloatIterablematchesAll in interface FloatIterablefilter - that should be appliedpublic float findFirst(Float2BooleanFunction filter)
FloatIterablefindFirst in interface FloatIterablefilter - that should be appliedpublic float reduce(float identity,
FloatFloatUnaryOperator operator)
FloatIterablereduce in interface FloatIterableidentity - the start valueoperator - the operation that should be appliedpublic float reduce(FloatFloatUnaryOperator operator)
FloatIterablereduce in interface FloatIterableoperator - the operation that should be appliedpublic int count(Float2BooleanFunction filter)
FloatIterablecount in interface FloatIterablefilter - that should be appliedpublic boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
clearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic 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 array