public class IntLinkedList extends AbstractIntList implements IntPriorityDequeue, IntStack
This implementation is optimized to improve how data is processed with interfaces like IntStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
ISizeProvider.CollectionSize| Constructor and Description |
|---|
IntLinkedList()
Creates a new LinkedList.
|
IntLinkedList(java.util.Collection<? extends java.lang.Integer> c)
Deprecated.
|
IntLinkedList(int... a)
Creates a new LinkedList with a Copy of the array
|
IntLinkedList(int[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
IntLinkedList(int[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
IntLinkedList(IntCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
IntLinkedList(IntList l)
Creates a new LinkedList a copy with the contents of the List.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
int e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(int[] 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.Integer> c)
Deprecated.
|
boolean |
addAll(int index,
IntCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
IntList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
void |
addElements(int from,
int[] 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
|
IntComparator |
comparator() |
boolean |
contains(int e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
IntLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(java.util.function.IntPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
int |
dequeue()
Method to extract a element from the PriorityQueue
|
int |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(int e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(int e)
Method to insert a element into the first Index instead of the last.
|
int[] |
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.IntBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
int |
findFirst(java.util.function.IntPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
int |
first()
Shows the element that is to be returned next
|
<E> void |
forEach(E input,
ObjectIntConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(IntConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
void |
forEachIndexed(IntIntConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
int[] |
getElements(int from,
int[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
int |
getInt(int index)
A Type-Specific get function to reduce (un)boxing
|
int |
indexOf(int e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
int |
last()
Peeking function for the last element
|
int |
lastIndexOf(int e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
IntListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(java.util.function.IntPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(java.util.function.IntPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(java.util.function.IntPredicate 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.IntStream |
parallelPrimitiveStream()
Returns a Java-Type-Specific Parallel Stream to reduce boxing/unboxing.
|
int |
peek(int index)
Peeking function to see whats inside the queue.
|
int |
pop()
Removes the Object on top of the stack.
|
java.util.stream.IntStream |
primitiveStream()
Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
|
void |
push(int e)
Inserts a given Object on top of the stack
|
int |
reduce(int identity,
IntIntUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
int |
reduce(IntIntUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remIf(java.util.function.IntPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remInt(int e)
A Type-Specific implementation of remove.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(IntCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(IntCollection c,
IntConsumer 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(int e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Integer> filter)
Deprecated.
|
int |
removeInt(int index)
A Type-Specific remove function to reduce (un)boxing
|
boolean |
removeLast(int e)
Removes the last found element in the queue
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Integer> o)
Deprecated.
|
void |
replaceInts(java.util.function.IntUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(IntCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(IntCollection c,
IntConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
int |
set(int index,
int e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
IntSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
int |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveInt(int e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
int[] |
toIntArray(int[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toIntArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toIntArrayarrayflatMap, 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, toIntArrayofpublic IntLinkedList()
@Deprecated public IntLinkedList(java.util.Collection<? extends java.lang.Integer> c)
c - the elements that should be added into the listpublic IntLinkedList(IntCollection c)
c - the elements that should be added into the listpublic IntLinkedList(IntList l)
l - the elements that should be added into the listpublic IntLinkedList(int... a)
a - the array that should be copiedpublic IntLinkedList(int[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic IntLinkedList(int[] 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(int e)
AbstractIntListList.add(int, Object)add in interface IntCollectionadd in interface IntListadd in class AbstractIntListe - the element to addList.add(Object)public void add(int index,
int e)
IntListpublic boolean addAll(int index,
IntCollection c)
IntListpublic boolean addAll(int index,
IntList c)
IntList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Integer> c)
addAll in interface java.util.List<java.lang.Integer>public void enqueue(int e)
IntPriorityQueueenqueue in interface IntPriorityQueuee - the element that should be insertedpublic void enqueueFirst(int e)
IntPriorityDequeueenqueueFirst in interface IntPriorityDequeuee - the element that should be inserted into the first placepublic void push(int e)
IntStackpush in interface IntStacke - the Object to insertStack.push(Object)public boolean addAll(int[] e,
int offset,
int length)
IntCollectionaddAll in interface IntCollectione - 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,
int[] a,
int offset,
int length)
IntListaddElements in interface IntListfrom - 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 int[] getElements(int from,
int[] a,
int offset,
int length)
IntListgetElements in interface IntListfrom - 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 int first()
IntPriorityQueuefirst in interface IntPriorityQueuepublic int last()
IntPriorityDequeuelast in interface IntPriorityDequeuepublic int peek(int index)
IntPriorityQueuepeek in interface IntStackpeek in interface IntPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public int getInt(int index)
IntList@Deprecated public boolean contains(java.lang.Object e)
AbstractIntCollectionThis 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.Integer>contains in interface java.util.List<java.lang.Integer>contains in interface IntCollectioncontains in interface IntListcontains in class AbstractIntCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractIntListindexOf in interface java.util.List<java.lang.Integer>indexOf in interface IntListindexOf in class AbstractIntListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractIntListlastIndexOf in interface java.util.List<java.lang.Integer>lastIndexOf in interface IntListlastIndexOf in class AbstractIntListo - the value that the index is searched for.public boolean contains(int e)
AbstractIntCollectioncontains in interface IntCollectioncontains in class AbstractIntCollectione - the element that should be searched for.public int indexOf(int e)
AbstractIntListindexOf in interface IntListindexOf in class AbstractIntListe - the value that the index is searched for.public int lastIndexOf(int e)
AbstractIntListlastIndexOf in interface IntListlastIndexOf in class AbstractIntListe - the value that the index is searched for.public IntListIterator listIterator(int index)
IntListlistIterator in interface java.util.List<java.lang.Integer>listIterator in interface IntListlistIterator in class AbstractIntListList.listIterator(int)public java.util.stream.IntStream primitiveStream()
primitiveStream in interface IntCollectionpublic java.util.stream.IntStream parallelPrimitiveStream()
parallelPrimitiveStream in interface IntCollectionpublic IntSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Integer>spliterator in interface java.util.Collection<java.lang.Integer>spliterator in interface java.util.List<java.lang.Integer>spliterator in interface IntCollectionspliterator in interface IntIterablespliterator in interface IntListpublic void forEach(IntConsumer action)
IntIterableforEach in interface IntIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntIntConsumer action)
IntIterableforEachIndexed in interface IntIterableforEachIndexed in interface IntListaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectIntConsumer<E> action)
IntIterableforEach in interface IntIterableE - 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.IntPredicate filter)
IntIterablematchesAny in interface IntIterablefilter - that should be appliedpublic boolean matchesNone(java.util.function.IntPredicate filter)
IntIterablematchesNone in interface IntIterablefilter - that should be appliedpublic boolean matchesAll(java.util.function.IntPredicate filter)
IntIterablematchesAll in interface IntIterablefilter - that should be appliedpublic int findFirst(java.util.function.IntPredicate filter)
IntIterablefindFirst in interface IntIterablefilter - that should be appliedpublic int reduce(int identity,
IntIntUnaryOperator operator)
IntIterablereduce in interface IntIterableidentity - the start valueoperator - the operation that should be appliedpublic int reduce(IntIntUnaryOperator operator)
IntIterablereduce in interface IntIterableoperator - the operation that should be appliedpublic int count(java.util.function.IntPredicate filter)
IntIterablecount in interface IntIterablefilter - that should be appliedpublic int set(int index,
int e)
IntList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Integer> o)
IntListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Integer>replaceAll in interface IntListpublic void replaceInts(java.util.function.IntUnaryOperator o)
IntListreplaceInts in interface IntListo - the action to replace the valuespublic void onChanged()
IntPriorityQueueonChanged in interface IntPriorityQueuepublic IntComparator comparator()
comparator in interface IntPriorityQueuepublic int dequeue()
IntPriorityQueuedequeue in interface IntPriorityQueuepublic int dequeueLast()
IntPriorityDequeuedequeueLast in interface IntPriorityDequeuepublic int pop()
IntStackpop in interface IntStackStack.pop()public boolean removeFirst(int e)
IntPriorityQueueremoveFirst in interface IntPriorityQueuee - the element that should be removedpublic boolean removeLast(int e)
IntPriorityQueueremoveLast in interface IntPriorityQueuee - the element that should be removedpublic int swapRemove(int index)
IntListswapRemove in interface IntListindex - the index of the element to be removedpublic boolean swapRemoveInt(int e)
IntListswapRemoveInt in interface IntListswapRemoveInt in class AbstractIntListe - the element that should be removedpublic boolean remInt(int e)
AbstractIntCollectionremInt in interface IntCollectionremInt in class AbstractIntCollectione - the element that is searched forCollection.remove(Object)public int removeInt(int index)
IntListpublic void removeElements(int from,
int to)
IntListremoveElements in interface IntListfrom - 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 int[] extractElements(int from,
int to)
IntListextractElements in interface IntListfrom - 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.IntBuffer buffer)
IntListfillBuffer in interface IntListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Integer>removeAll in interface java.util.List<java.lang.Integer>removeAll in class java.util.AbstractCollection<java.lang.Integer>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Integer>retainAll in interface java.util.List<java.lang.Integer>retainAll in class java.util.AbstractCollection<java.lang.Integer>public boolean removeAll(IntCollection c)
AbstractIntCollectionremoveAll in interface IntCollectionremoveAll in class AbstractIntCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(IntCollection c, IntConsumer r)
IntCollectionremoveAll in interface IntCollectionremoveAll in class AbstractIntCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(IntCollection c)
AbstractIntCollectionretainAll in interface IntCollectionretainAll in class AbstractIntCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(IntCollection c, IntConsumer r)
IntCollectionretainAll in interface IntCollectionretainAll in class AbstractIntCollectionc - 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.Integer> filter)
IntCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Integer>removeIf in interface IntCollectionpublic boolean remIf(java.util.function.IntPredicate filter)
IntCollectionRemoves elements that were selected by the filter
remIf in interface IntCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Integer>toArray in interface java.util.List<java.lang.Integer>toArray in class java.util.AbstractCollection<java.lang.Integer>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Integer>toArray in interface java.util.List<java.lang.Integer>toArray in class java.util.AbstractCollection<java.lang.Integer>public int[] toIntArray(int[] a)
AbstractIntCollectiontoIntArray in interface IntCollectiontoIntArray in interface IntPriorityQueuetoIntArray in class AbstractIntCollectiona - 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()
IntStacksize in interface java.util.Collection<java.lang.Integer>size in interface java.util.List<java.lang.Integer>size in interface IntStacksize in interface IntPriorityQueuesize in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Integer>public void clear()
IntPriorityQueueclear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.List<java.lang.Integer>clear in interface IntStackclear in interface IntPriorityQueueclear in class java.util.AbstractCollection<java.lang.Integer>public IntLinkedList copy()
IntCollectioncopy in interface IntCollectioncopy in interface IntListcopy in interface IntPriorityDequeuecopy in interface IntPriorityQueuecopy in class AbstractIntList