public class FloatLinkedList extends AbstractFloatList implements FloatPriorityDequeue, FloatStack
This implementation is optimized to improve how data is processed with interfaces like FloatStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
| Constructor and Description |
|---|
FloatLinkedList()
Creates a new LinkedList.
|
FloatLinkedList(java.util.Collection<? extends java.lang.Float> c)
Deprecated.
|
FloatLinkedList(float... a)
Creates a new LinkedList with a Copy of the array
|
FloatLinkedList(float[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
FloatLinkedList(float[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
FloatLinkedList(FloatCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
FloatLinkedList(FloatList l)
Creates a new LinkedList a copy with the contents of the List.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(float e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
float e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(float[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Float> c)
Deprecated.
|
boolean |
addAll(int index,
FloatCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
FloatList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
void |
addElements(int from,
float[] a,
int offset,
int length)
A function to fast add elements to the list
|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
FloatComparator |
comparator() |
boolean |
contains(float e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
FloatLinkedList |
copy()
A Function that does a shallow clone of the Collection 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[] |
extractElements(int from,
int to)
A function to fast extract elements out of the list, this removes the elements that were fetched.
|
void |
fillBuffer(java.nio.FloatBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
float |
findFirst(Float2BooleanFunction 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
|
float[] |
getElements(int from,
float[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
float |
getFloat(int index)
A Type-Specific get function to reduce (un)boxing
|
int |
indexOf(float e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
float |
last()
Peeking function for the last element
|
int |
lastIndexOf(float e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
FloatListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
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
|
java.util.stream.DoubleStream |
parallelPrimitiveStream()
Returns a Java-Type-Specific Parallel Stream to reduce boxing/unboxing.
|
float |
peek(int index)
Peeking function to see whats inside the queue.
|
float |
pop()
Removes the Object on top of the stack.
|
java.util.stream.DoubleStream |
primitiveStream()
Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
|
void |
push(float e)
Inserts a given Object on top of the stack
|
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 |
remFloat(float e)
A Type-Specific implementation of remove.
|
boolean |
remIf(java.util.function.DoublePredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(FloatCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(FloatCollection c,
FloatConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
void |
removeElements(int from,
int to)
a function to fast remove elements from the list.
|
boolean |
removeFirst(float e)
Removes the first found element in the queue
|
float |
removeFloat(int index)
A Type-Specific remove function to reduce (un)boxing
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Float> filter)
Deprecated.
|
boolean |
removeLast(float e)
Removes the last found element in the queue
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Float> o)
Deprecated.
|
void |
replaceFloats(java.util.function.DoubleUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(FloatCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(FloatCollection c,
FloatConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
float |
set(int index,
float e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
FloatSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
float |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveFloat(float e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
float[] |
toFloatArray(float[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toFloatArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toFloatArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, iterator, limit, map, peek, pour, pourAsList, pourAsSet, sortedisEmpty, topadd, addElements, addElements, addIfAbsent, addIfPresent, get, getElements, remove, remove, set, sort, sort, synchronize, synchronize, unmodifiable, unstableSort, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, pour, toFloatArraypublic FloatLinkedList()
@Deprecated public FloatLinkedList(java.util.Collection<? extends java.lang.Float> c)
c - the elements that should be added into the listpublic FloatLinkedList(FloatCollection c)
c - the elements that should be added into the listpublic FloatLinkedList(FloatList l)
l - the elements that should be added into the listpublic FloatLinkedList(float... a)
a - the array that should be copiedpublic FloatLinkedList(float[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic FloatLinkedList(float[] a,
int offset,
int length)
a - the array that should be copiedoffset - the starting offset of where the array should be copied fromlength - the desired length that should be copiedjava.lang.IllegalStateException - if offset is smaller then 0java.lang.IllegalStateException - if the offset + length exceeds the array lengthpublic boolean add(float e)
AbstractFloatListList.add(int, Object)add in interface FloatCollectionadd in interface FloatListadd in class AbstractFloatListe - the element to addList.add(Object)public void add(int index,
float e)
FloatListpublic boolean addAll(int index,
FloatCollection c)
FloatListpublic boolean addAll(int index,
FloatList c)
FloatList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Float> c)
addAll in interface java.util.List<java.lang.Float>public 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 void push(float e)
FloatStackpush in interface FloatStacke - the Object to insertStack.push(Object)public boolean addAll(float[] e,
int offset,
int length)
FloatCollectionaddAll in interface FloatCollectione - the elements that should be addedoffset - where to start within the arraylength - how many elements of the array should be addedpublic void addElements(int from,
float[] a,
int offset,
int length)
FloatListaddElements in interface FloatListfrom - the index where the elements should be added into the lista - the elements that should be addedoffset - the start index of the array should be read fromlength - how many elements should be read frompublic float[] getElements(int from,
float[] a,
int offset,
int length)
FloatListgetElements in interface FloatListfrom - index where the list should be fetching elements froma - the array where the values should be inserted tooffset - the startIndex of where the array should be written tolength - the number of elements the values should be fetched frompublic float first()
FloatPriorityQueuefirst in interface FloatPriorityQueuepublic float last()
FloatPriorityDequeuelast in interface FloatPriorityDequeuepublic float peek(int index)
FloatPriorityQueuepeek in interface FloatStackpeek in interface FloatPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public float getFloat(int index)
FloatList@Deprecated public boolean contains(java.lang.Object e)
AbstractFloatCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
contains in interface java.util.Collection<java.lang.Float>contains in interface java.util.List<java.lang.Float>contains in interface FloatCollectioncontains in interface FloatListcontains in class AbstractFloatCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractFloatListindexOf in interface java.util.List<java.lang.Float>indexOf in interface FloatListindexOf in class AbstractFloatListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractFloatListlastIndexOf in interface java.util.List<java.lang.Float>lastIndexOf in interface FloatListlastIndexOf in class AbstractFloatListo - the value that the index is searched for.public boolean contains(float e)
AbstractFloatCollectioncontains in interface FloatCollectioncontains in class AbstractFloatCollectione - the element that should be searched for.public int indexOf(float e)
AbstractFloatListindexOf in interface FloatListindexOf in class AbstractFloatListe - the value that the index is searched for.public int lastIndexOf(float e)
AbstractFloatListlastIndexOf in interface FloatListlastIndexOf in class AbstractFloatListe - the value that the index is searched for.public FloatListIterator listIterator(int index)
FloatListlistIterator in interface java.util.List<java.lang.Float>listIterator in interface FloatListlistIterator in class AbstractFloatListList.listIterator(int)public java.util.stream.DoubleStream primitiveStream()
primitiveStream in interface FloatCollectionpublic java.util.stream.DoubleStream parallelPrimitiveStream()
parallelPrimitiveStream in interface FloatCollectionpublic FloatSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Float>spliterator in interface java.util.Collection<java.lang.Float>spliterator in interface java.util.List<java.lang.Float>spliterator in interface FloatCollectionspliterator in interface FloatIterablespliterator in interface FloatListpublic 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 float set(int index,
float e)
FloatList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Float> o)
FloatListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Float>replaceAll in interface FloatListpublic void replaceFloats(java.util.function.DoubleUnaryOperator o)
FloatListreplaceFloats in interface FloatListo - the action to replace the valuespublic void onChanged()
FloatPriorityQueueonChanged in interface FloatPriorityQueuepublic FloatComparator comparator()
comparator in interface FloatPriorityQueuepublic float dequeue()
FloatPriorityQueuedequeue in interface FloatPriorityQueuepublic float dequeueLast()
FloatPriorityDequeuedequeueLast in interface FloatPriorityDequeuepublic float pop()
FloatStackpop in interface FloatStackStack.pop()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 float swapRemove(int index)
FloatListswapRemove in interface FloatListindex - the index of the element to be removedpublic boolean swapRemoveFloat(float e)
FloatListswapRemoveFloat in interface FloatListswapRemoveFloat in class AbstractFloatListe - the element that should be removedpublic boolean remFloat(float e)
AbstractFloatCollectionremFloat in interface FloatCollectionremFloat in class AbstractFloatCollectione - the element that is searched forCollection.remove(Object)public float removeFloat(int index)
FloatListremoveFloat in interface FloatListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
FloatListremoveElements in interface FloatListfrom - the start index of where the elements should be removed from (inclusive)to - the end index of where the elements should be removed to (exclusive)public float[] extractElements(int from,
int to)
FloatListextractElements in interface FloatListfrom - the start index of where the elements should be fetched from (inclusive)to - the end index of where the elements should be fetched to (exclusive)public void fillBuffer(java.nio.FloatBuffer buffer)
FloatListfillBuffer in interface FloatListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Float>removeAll in interface java.util.List<java.lang.Float>removeAll in class java.util.AbstractCollection<java.lang.Float>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Float>retainAll in interface java.util.List<java.lang.Float>retainAll in class java.util.AbstractCollection<java.lang.Float>public boolean removeAll(FloatCollection c)
AbstractFloatCollectionremoveAll in interface FloatCollectionremoveAll in class AbstractFloatCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(FloatCollection c, FloatConsumer r)
FloatCollectionremoveAll in interface FloatCollectionremoveAll in class AbstractFloatCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(FloatCollection c)
AbstractFloatCollectionretainAll in interface FloatCollectionretainAll in class AbstractFloatCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(FloatCollection c, FloatConsumer r)
FloatCollectionretainAll in interface FloatCollectionretainAll in class AbstractFloatCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Float> filter)
FloatCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Float>removeIf in interface FloatCollectionpublic boolean remIf(java.util.function.DoublePredicate filter)
FloatCollectionRemoves elements that were selected by the filter
remIf in interface FloatCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Float>toArray in interface java.util.List<java.lang.Float>toArray in class java.util.AbstractCollection<java.lang.Float>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Float>toArray in interface java.util.List<java.lang.Float>toArray in class java.util.AbstractCollection<java.lang.Float>public float[] toFloatArray(float[] a)
AbstractFloatCollectiontoFloatArray in interface FloatCollectiontoFloatArray in interface FloatPriorityQueuetoFloatArray in class AbstractFloatCollectiona - array that the elements should be injected to. If null or to small a new array with the right size is createdCollection.toArray(Object[])public int size()
FloatStacksize in interface java.util.Collection<java.lang.Float>size in interface java.util.List<java.lang.Float>size in interface FloatStacksize in interface FloatPriorityQueuesize in class java.util.AbstractCollection<java.lang.Float>public void clear()
FloatPriorityQueueclear in interface java.util.Collection<java.lang.Float>clear in interface java.util.List<java.lang.Float>clear in interface FloatStackclear in interface FloatPriorityQueueclear in class java.util.AbstractCollection<java.lang.Float>public FloatLinkedList copy()
FloatCollectioncopy in interface FloatCollectioncopy in interface FloatListcopy in interface FloatPriorityDequeuecopy in interface FloatPriorityQueuecopy in class AbstractFloatList