public class DoubleLinkedList extends AbstractDoubleList implements DoublePriorityDequeue, DoubleStack
This implementation is optimized to improve how data is processed with interfaces like DoubleStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
| Constructor and Description |
|---|
DoubleLinkedList()
Creates a new LinkedList.
|
DoubleLinkedList(java.util.Collection<? extends java.lang.Double> c)
Deprecated.
|
DoubleLinkedList(double... a)
Creates a new LinkedList with a Copy of the array
|
DoubleLinkedList(double[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
DoubleLinkedList(double[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
DoubleLinkedList(DoubleCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
DoubleLinkedList(DoubleList l)
Creates a new LinkedList a copy with the contents of the List.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
double e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(double[] 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.Double> c)
Deprecated.
|
boolean |
addAll(int index,
DoubleCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
DoubleList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
void |
addElements(int from,
double[] 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
|
DoubleComparator |
comparator() |
boolean |
contains(double e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
DoubleLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Double2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
double |
dequeue()
Method to extract a element from the PriorityQueue
|
double |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(double e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(double e)
Method to insert a element into the first Index instead of the last.
|
double[] |
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.DoubleBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
double |
findFirst(Double2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
double |
first()
Shows the element that is to be returned next
|
void |
forEach(DoubleConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectDoubleConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
double |
getDouble(int index)
A Type-Specific get function to reduce (un)boxing
|
double[] |
getElements(int from,
double[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
int |
indexOf(double e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
double |
last()
Peeking function for the last element
|
int |
lastIndexOf(double e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
DoubleListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(Double2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Double2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Double2BooleanFunction 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.
|
double |
peek(int index)
Peeking function to see whats inside the queue.
|
double |
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(double e)
Inserts a given Object on top of the stack
|
double |
reduce(double identity,
DoubleDoubleUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
double |
reduce(DoubleDoubleUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remDouble(double 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(DoubleCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(DoubleCollection c,
DoubleConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
double |
removeDouble(int index)
A Type-Specific remove function to reduce (un)boxing
|
void |
removeElements(int from,
int to)
a function to fast remove elements from the list.
|
boolean |
removeFirst(double e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Double> filter)
Deprecated.
|
boolean |
removeLast(double e)
Removes the last found element in the queue
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Double> o)
Deprecated.
|
void |
replaceDoubles(java.util.function.DoubleUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(DoubleCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(DoubleCollection c,
DoubleConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
double |
set(int index,
double e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
DoubleSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
double |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveDouble(double e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
double[] |
toDoubleArray(double[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toDoubleArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toDoubleArrayarrayflatMap, 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, toDoubleArraypublic DoubleLinkedList()
@Deprecated public DoubleLinkedList(java.util.Collection<? extends java.lang.Double> c)
c - the elements that should be added into the listpublic DoubleLinkedList(DoubleCollection c)
c - the elements that should be added into the listpublic DoubleLinkedList(DoubleList l)
l - the elements that should be added into the listpublic DoubleLinkedList(double... a)
a - the array that should be copiedpublic DoubleLinkedList(double[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic DoubleLinkedList(double[] 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(double e)
AbstractDoubleListList.add(int, Object)add in interface DoubleCollectionadd in interface DoubleListadd in class AbstractDoubleListe - the element to addList.add(Object)public void add(int index,
double e)
DoubleListadd in interface DoubleListindex - index at which the specified element is to be insertede - the element to addList.add(int, Object)public boolean addAll(int index,
DoubleCollection c)
DoubleListaddAll in interface DoubleListindex - index at which the specified elements is to be insertedc - the elements that need to be addedList.addAll(int, java.util.Collection)public boolean addAll(int index,
DoubleList c)
DoubleListaddAll in interface DoubleListindex - index at which the specified elements is to be insertedc - the elements that need to be added@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Double> c)
addAll in interface java.util.List<java.lang.Double>public void enqueue(double e)
DoublePriorityQueueenqueue in interface DoublePriorityQueuee - the element that should be insertedpublic void enqueueFirst(double e)
DoublePriorityDequeueenqueueFirst in interface DoublePriorityDequeuee - the element that should be inserted into the first placepublic void push(double e)
DoubleStackpush in interface DoubleStacke - the Object to insertStack.push(Object)public boolean addAll(double[] e,
int offset,
int length)
DoubleCollectionaddAll in interface DoubleCollectione - 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,
double[] a,
int offset,
int length)
DoubleListaddElements in interface DoubleListfrom - 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 double[] getElements(int from,
double[] a,
int offset,
int length)
DoubleListgetElements in interface DoubleListfrom - 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 double first()
DoublePriorityQueuefirst in interface DoublePriorityQueuepublic double last()
DoublePriorityDequeuelast in interface DoublePriorityDequeuepublic double peek(int index)
DoublePriorityQueuepeek in interface DoubleStackpeek in interface DoublePriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public double getDouble(int index)
DoubleListgetDouble in interface DoubleListindex - the index of the value that is requestedList.get(int)@Deprecated public boolean contains(java.lang.Object e)
AbstractDoubleCollectionThis 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.Double>contains in interface java.util.List<java.lang.Double>contains in interface DoubleCollectioncontains in interface DoubleListcontains in class AbstractDoubleCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractDoubleListindexOf in interface java.util.List<java.lang.Double>indexOf in interface DoubleListindexOf in class AbstractDoubleListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractDoubleListlastIndexOf in interface java.util.List<java.lang.Double>lastIndexOf in interface DoubleListlastIndexOf in class AbstractDoubleListo - the value that the index is searched for.public boolean contains(double e)
AbstractDoubleCollectioncontains in interface DoubleCollectioncontains in class AbstractDoubleCollectione - the element that should be searched for.public int indexOf(double e)
AbstractDoubleListindexOf in interface DoubleListindexOf in class AbstractDoubleListe - the value that the index is searched for.public int lastIndexOf(double e)
AbstractDoubleListlastIndexOf in interface DoubleListlastIndexOf in class AbstractDoubleListe - the value that the index is searched for.public DoubleListIterator listIterator(int index)
DoubleListlistIterator in interface java.util.List<java.lang.Double>listIterator in interface DoubleListlistIterator in class AbstractDoubleListList.listIterator(int)public java.util.stream.DoubleStream primitiveStream()
primitiveStream in interface DoubleCollectionpublic java.util.stream.DoubleStream parallelPrimitiveStream()
parallelPrimitiveStream in interface DoubleCollectionpublic DoubleSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Double>spliterator in interface java.util.Collection<java.lang.Double>spliterator in interface java.util.List<java.lang.Double>spliterator in interface DoubleCollectionspliterator in interface DoubleIterablespliterator in interface DoubleListpublic void forEach(DoubleConsumer action)
DoubleIterableforEach in interface DoubleIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectDoubleConsumer<E> action)
DoubleIterableforEach in interface DoubleIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Double2BooleanFunction filter)
DoubleIterablematchesAny in interface DoubleIterablefilter - that should be appliedpublic boolean matchesNone(Double2BooleanFunction filter)
DoubleIterablematchesNone in interface DoubleIterablefilter - that should be appliedpublic boolean matchesAll(Double2BooleanFunction filter)
DoubleIterablematchesAll in interface DoubleIterablefilter - that should be appliedpublic double findFirst(Double2BooleanFunction filter)
DoubleIterablefindFirst in interface DoubleIterablefilter - that should be appliedpublic double reduce(double identity,
DoubleDoubleUnaryOperator operator)
DoubleIterablereduce in interface DoubleIterableidentity - the start valueoperator - the operation that should be appliedpublic double reduce(DoubleDoubleUnaryOperator operator)
DoubleIterablereduce in interface DoubleIterableoperator - the operation that should be appliedpublic int count(Double2BooleanFunction filter)
DoubleIterablecount in interface DoubleIterablefilter - that should be appliedpublic double set(int index,
double e)
DoubleListset in interface DoubleListindex - index of the element to replacee - element to be stored at the specified positionList.set(int, Object)@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Double> o)
DoubleListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Double>replaceAll in interface DoubleListpublic void replaceDoubles(java.util.function.DoubleUnaryOperator o)
DoubleListreplaceDoubles in interface DoubleListo - the action to replace the valuespublic void onChanged()
DoublePriorityQueueonChanged in interface DoublePriorityQueuepublic DoubleComparator comparator()
comparator in interface DoublePriorityQueuepublic double dequeue()
DoublePriorityQueuedequeue in interface DoublePriorityQueuepublic double dequeueLast()
DoublePriorityDequeuedequeueLast in interface DoublePriorityDequeuepublic double pop()
DoubleStackpop in interface DoubleStackStack.pop()public boolean removeFirst(double e)
DoublePriorityQueueremoveFirst in interface DoublePriorityQueuee - the element that should be removedpublic boolean removeLast(double e)
DoublePriorityQueueremoveLast in interface DoublePriorityQueuee - the element that should be removedpublic double swapRemove(int index)
DoubleListswapRemove in interface DoubleListindex - the index of the element to be removedpublic boolean swapRemoveDouble(double e)
DoubleListswapRemoveDouble in interface DoubleListswapRemoveDouble in class AbstractDoubleListe - the element that should be removedpublic boolean remDouble(double e)
AbstractDoubleCollectionremDouble in interface DoubleCollectionremDouble in class AbstractDoubleCollectione - the element that is searched forCollection.remove(Object)public double removeDouble(int index)
DoubleListremoveDouble in interface DoubleListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
DoubleListremoveElements in interface DoubleListfrom - 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 double[] extractElements(int from,
int to)
DoubleListextractElements in interface DoubleListfrom - 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.DoubleBuffer buffer)
DoubleListfillBuffer in interface DoubleListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Double>removeAll in interface java.util.List<java.lang.Double>removeAll in class java.util.AbstractCollection<java.lang.Double>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Double>retainAll in interface java.util.List<java.lang.Double>retainAll in class java.util.AbstractCollection<java.lang.Double>public boolean removeAll(DoubleCollection c)
AbstractDoubleCollectionremoveAll in interface DoubleCollectionremoveAll in class AbstractDoubleCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(DoubleCollection c, DoubleConsumer r)
DoubleCollectionremoveAll in interface DoubleCollectionremoveAll in class AbstractDoubleCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(DoubleCollection c)
AbstractDoubleCollectionretainAll in interface DoubleCollectionretainAll in class AbstractDoubleCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(DoubleCollection c, DoubleConsumer r)
DoubleCollectionretainAll in interface DoubleCollectionretainAll in class AbstractDoubleCollectionc - 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.Double> filter)
DoubleCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Double>removeIf in interface DoubleCollectionpublic boolean remIf(java.util.function.DoublePredicate filter)
DoubleCollectionRemoves elements that were selected by the filter
remIf in interface DoubleCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Double>toArray in interface java.util.List<java.lang.Double>toArray in class java.util.AbstractCollection<java.lang.Double>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Double>toArray in interface java.util.List<java.lang.Double>toArray in class java.util.AbstractCollection<java.lang.Double>public double[] toDoubleArray(double[] a)
AbstractDoubleCollectiontoDoubleArray in interface DoubleCollectiontoDoubleArray in interface DoublePriorityQueuetoDoubleArray in class AbstractDoubleCollectiona - 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()
DoubleStacksize in interface java.util.Collection<java.lang.Double>size in interface java.util.List<java.lang.Double>size in interface DoubleStacksize in interface DoublePriorityQueuesize in class java.util.AbstractCollection<java.lang.Double>public void clear()
DoublePriorityQueueclear in interface java.util.Collection<java.lang.Double>clear in interface java.util.List<java.lang.Double>clear in interface DoubleStackclear in interface DoublePriorityQueueclear in class java.util.AbstractCollection<java.lang.Double>public DoubleLinkedList copy()
DoubleCollectioncopy in interface DoubleCollectioncopy in interface DoubleListcopy in interface DoublePriorityDequeuecopy in interface DoublePriorityQueuecopy in class AbstractDoubleList