public class LongLinkedList extends AbstractLongList implements LongPriorityDequeue, LongStack
This implementation is optimized to improve how data is processed with interfaces like LongStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
ISizeProvider.CollectionSize| Constructor and Description |
|---|
LongLinkedList()
Creates a new LinkedList.
|
LongLinkedList(java.util.Collection<? extends java.lang.Long> c)
Deprecated.
|
LongLinkedList(long... a)
Creates a new LinkedList with a Copy of the array
|
LongLinkedList(long[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
LongLinkedList(long[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
LongLinkedList(LongCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
LongLinkedList(LongList l)
Creates a new LinkedList a copy with the contents of the List.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
long e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
add(long e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Long> c)
Deprecated.
|
boolean |
addAll(int index,
LongCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
LongList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
boolean |
addAll(long[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
void |
addElements(int from,
long[] 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
|
LongComparator |
comparator() |
boolean |
contains(long e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
LongLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(java.util.function.LongPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
long |
dequeue()
Method to extract a element from the PriorityQueue
|
long |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(long e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(long e)
Method to insert a element into the first Index instead of the last.
|
long[] |
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.LongBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
long |
findFirst(java.util.function.LongPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
long |
first()
Shows the element that is to be returned next
|
<E> void |
forEach(E input,
ObjectLongConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(LongConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
void |
forEachIndexed(IntLongConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
long[] |
getElements(int from,
long[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
long |
getLong(int index)
A Type-Specific get function to reduce (un)boxing
|
int |
indexOf(long e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
long |
last()
Peeking function for the last element
|
int |
lastIndexOf(long e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
LongListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(java.util.function.LongPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(java.util.function.LongPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(java.util.function.LongPredicate 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.LongStream |
parallelPrimitiveStream()
Returns a Java-Type-Specific Parallel Stream to reduce boxing/unboxing.
|
long |
peek(int index)
Peeking function to see whats inside the queue.
|
long |
pop()
Removes the Object on top of the stack.
|
java.util.stream.LongStream |
primitiveStream()
Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
|
void |
push(long e)
Inserts a given Object on top of the stack
|
long |
reduce(long identity,
LongLongUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
long |
reduce(LongLongUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remIf(java.util.function.LongPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remLong(long e)
A Type-Specific implementation of remove.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(LongCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(LongCollection c,
LongConsumer 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(long e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Long> filter)
Deprecated.
|
boolean |
removeLast(long e)
Removes the last found element in the queue
|
long |
removeLong(int index)
A Type-Specific remove function to reduce (un)boxing
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Long> o)
Deprecated.
|
void |
replaceLongs(java.util.function.LongUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(LongCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(LongCollection c,
LongConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
long |
set(int index,
long e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
LongSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
long |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveLong(long e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
long[] |
toLongArray(long[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toLongArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toLongArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, iterator, limit, map, peek, pour, pourAsList, pourAsSet, repeat, sortedadd, addElements, addElements, addIfAbsent, addIfPresent, get, getElements, remove, remove, set, sort, sort, synchronize, synchronize, unmodifiable, unstableSort, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, pour, toLongArrayofpublic LongLinkedList()
@Deprecated public LongLinkedList(java.util.Collection<? extends java.lang.Long> c)
c - the elements that should be added into the listpublic LongLinkedList(LongCollection c)
c - the elements that should be added into the listpublic LongLinkedList(LongList l)
l - the elements that should be added into the listpublic LongLinkedList(long... a)
a - the array that should be copiedpublic LongLinkedList(long[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic LongLinkedList(long[] 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(long e)
AbstractLongListList.add(int, Object)add in interface LongCollectionadd in interface LongListadd in class AbstractLongListe - the element to addList.add(Object)public void add(int index,
long e)
LongListpublic boolean addAll(int index,
LongCollection c)
LongListpublic boolean addAll(int index,
LongList c)
LongList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Long> c)
addAll in interface java.util.List<java.lang.Long>public void enqueue(long e)
LongPriorityQueueenqueue in interface LongPriorityQueuee - the element that should be insertedpublic void enqueueFirst(long e)
LongPriorityDequeueenqueueFirst in interface LongPriorityDequeuee - the element that should be inserted into the first placepublic void push(long e)
LongStackpush in interface LongStacke - the Object to insertStack.push(Object)public boolean addAll(long[] e,
int offset,
int length)
LongCollectionaddAll in interface LongCollectione - 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,
long[] a,
int offset,
int length)
LongListaddElements in interface LongListfrom - 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 long[] getElements(int from,
long[] a,
int offset,
int length)
LongListgetElements in interface LongListfrom - 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 long first()
LongPriorityQueuefirst in interface LongPriorityQueuepublic long last()
LongPriorityDequeuelast in interface LongPriorityDequeuepublic long peek(int index)
LongPriorityQueuepeek in interface LongStackpeek in interface LongPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public long getLong(int index)
LongList@Deprecated public boolean contains(java.lang.Object e)
AbstractLongCollectionThis 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.Long>contains in interface java.util.List<java.lang.Long>contains in interface LongCollectioncontains in interface LongListcontains in class AbstractLongCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractLongListindexOf in interface java.util.List<java.lang.Long>indexOf in interface LongListindexOf in class AbstractLongListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractLongListlastIndexOf in interface java.util.List<java.lang.Long>lastIndexOf in interface LongListlastIndexOf in class AbstractLongListo - the value that the index is searched for.public boolean contains(long e)
AbstractLongCollectioncontains in interface LongCollectioncontains in class AbstractLongCollectione - the element that should be searched for.public int indexOf(long e)
AbstractLongListindexOf in interface LongListindexOf in class AbstractLongListe - the value that the index is searched for.public int lastIndexOf(long e)
AbstractLongListlastIndexOf in interface LongListlastIndexOf in class AbstractLongListe - the value that the index is searched for.public LongListIterator listIterator(int index)
LongListlistIterator in interface java.util.List<java.lang.Long>listIterator in interface LongListlistIterator in class AbstractLongListList.listIterator(int)public java.util.stream.LongStream primitiveStream()
primitiveStream in interface LongCollectionpublic java.util.stream.LongStream parallelPrimitiveStream()
parallelPrimitiveStream in interface LongCollectionpublic LongSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Long>spliterator in interface java.util.Collection<java.lang.Long>spliterator in interface java.util.List<java.lang.Long>spliterator in interface LongCollectionspliterator in interface LongIterablespliterator in interface LongListpublic void forEach(LongConsumer action)
LongIterableforEach in interface LongIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntLongConsumer action)
LongIterableforEachIndexed in interface LongIterableforEachIndexed in interface LongListaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectLongConsumer<E> action)
LongIterableforEach in interface LongIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(java.util.function.LongPredicate filter)
LongIterablematchesAny in interface LongIterablefilter - that should be appliedpublic boolean matchesNone(java.util.function.LongPredicate filter)
LongIterablematchesNone in interface LongIterablefilter - that should be appliedpublic boolean matchesAll(java.util.function.LongPredicate filter)
LongIterablematchesAll in interface LongIterablefilter - that should be appliedpublic long findFirst(java.util.function.LongPredicate filter)
LongIterablefindFirst in interface LongIterablefilter - that should be appliedpublic long reduce(long identity,
LongLongUnaryOperator operator)
LongIterablereduce in interface LongIterableidentity - the start valueoperator - the operation that should be appliedpublic long reduce(LongLongUnaryOperator operator)
LongIterablereduce in interface LongIterableoperator - the operation that should be appliedpublic int count(java.util.function.LongPredicate filter)
LongIterablecount in interface LongIterablefilter - that should be appliedpublic long set(int index,
long e)
LongList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Long> o)
LongListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Long>replaceAll in interface LongListpublic void replaceLongs(java.util.function.LongUnaryOperator o)
LongListreplaceLongs in interface LongListo - the action to replace the valuespublic void onChanged()
LongPriorityQueueonChanged in interface LongPriorityQueuepublic LongComparator comparator()
comparator in interface LongPriorityQueuepublic long dequeue()
LongPriorityQueuedequeue in interface LongPriorityQueuepublic long dequeueLast()
LongPriorityDequeuedequeueLast in interface LongPriorityDequeuepublic long pop()
LongStackpop in interface LongStackStack.pop()public boolean removeFirst(long e)
LongPriorityQueueremoveFirst in interface LongPriorityQueuee - the element that should be removedpublic boolean removeLast(long e)
LongPriorityQueueremoveLast in interface LongPriorityQueuee - the element that should be removedpublic long swapRemove(int index)
LongListswapRemove in interface LongListindex - the index of the element to be removedpublic boolean swapRemoveLong(long e)
LongListswapRemoveLong in interface LongListswapRemoveLong in class AbstractLongListe - the element that should be removedpublic boolean remLong(long e)
AbstractLongCollectionremLong in interface LongCollectionremLong in class AbstractLongCollectione - the element that is searched forCollection.remove(Object)public long removeLong(int index)
LongListremoveLong in interface LongListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
LongListremoveElements in interface LongListfrom - 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 long[] extractElements(int from,
int to)
LongListextractElements in interface LongListfrom - 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.LongBuffer buffer)
LongListfillBuffer in interface LongListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Long>removeAll in interface java.util.List<java.lang.Long>removeAll in class java.util.AbstractCollection<java.lang.Long>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Long>retainAll in interface java.util.List<java.lang.Long>retainAll in class java.util.AbstractCollection<java.lang.Long>public boolean removeAll(LongCollection c)
AbstractLongCollectionremoveAll in interface LongCollectionremoveAll in class AbstractLongCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(LongCollection c, LongConsumer r)
LongCollectionremoveAll in interface LongCollectionremoveAll in class AbstractLongCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(LongCollection c)
AbstractLongCollectionretainAll in interface LongCollectionretainAll in class AbstractLongCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(LongCollection c, LongConsumer r)
LongCollectionretainAll in interface LongCollectionretainAll in class AbstractLongCollectionc - 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.Long> filter)
LongCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Long>removeIf in interface LongCollectionpublic boolean remIf(java.util.function.LongPredicate filter)
LongCollectionRemoves elements that were selected by the filter
remIf in interface LongCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Long>toArray in interface java.util.List<java.lang.Long>toArray in class java.util.AbstractCollection<java.lang.Long>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Long>toArray in interface java.util.List<java.lang.Long>toArray in class java.util.AbstractCollection<java.lang.Long>public long[] toLongArray(long[] a)
AbstractLongCollectiontoLongArray in interface LongCollectiontoLongArray in interface LongPriorityQueuetoLongArray in class AbstractLongCollectiona - 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()
LongStacksize in interface java.util.Collection<java.lang.Long>size in interface java.util.List<java.lang.Long>size in interface LongStacksize in interface LongPriorityQueuesize in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Long>public void clear()
LongPriorityQueueclear in interface java.util.Collection<java.lang.Long>clear in interface java.util.List<java.lang.Long>clear in interface LongStackclear in interface LongPriorityQueueclear in class java.util.AbstractCollection<java.lang.Long>public LongLinkedList copy()
LongCollectioncopy in interface LongCollectioncopy in interface LongListcopy in interface LongPriorityDequeuecopy in interface LongPriorityQueuecopy in class AbstractLongList