public class ShortLinkedList extends AbstractShortList implements ShortPriorityDequeue, ShortStack
This implementation is optimized to improve how data is processed with interfaces like ShortStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ShortLinkedList()
Creates a new LinkedList.
|
ShortLinkedList(java.util.Collection<? extends java.lang.Short> c)
Deprecated.
|
ShortLinkedList(short... a)
Creates a new LinkedList with a Copy of the array
|
ShortLinkedList(short[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
ShortLinkedList(short[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
ShortLinkedList(ShortCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
ShortLinkedList(ShortList l)
Creates a new LinkedList a copy with the contents of the List.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
short e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
add(short 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.Short> c)
Deprecated.
|
boolean |
addAll(int index,
ShortCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
ShortList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
boolean |
addAll(short[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
void |
addElements(int from,
short[] 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
|
ShortComparator |
comparator() |
boolean |
contains(java.lang.Object e)
Deprecated.
|
boolean |
contains(short e)
A Type-Specific implementation of contains.
|
ShortLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(ShortPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
short |
dequeue()
Method to extract a element from the PriorityQueue
|
short |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(short e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(short e)
Method to insert a element into the first Index instead of the last.
|
short[] |
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.ShortBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
short |
findFirst(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
short |
first()
Shows the element that is to be returned next
|
<E> void |
forEach(E input,
ObjectShortConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
void |
forEach(ShortConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
void |
forEachIndexed(IntShortConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
short[] |
getElements(int from,
short[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
short |
getShort(int index)
A Type-Specific get function to reduce (un)boxing
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
int |
indexOf(short e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
short |
last()
Peeking function for the last element
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
int |
lastIndexOf(short e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
ShortListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(ShortPredicate 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.
|
short |
peek(int index)
Peeking function to see whats inside the queue.
|
short |
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(short e)
Inserts a given Object on top of the stack
|
short |
reduce(short identity,
ShortShortUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
short |
reduce(ShortShortUnaryOperator 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 |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeAll(ShortCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(ShortCollection c,
ShortConsumer 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(short e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
Deprecated.
|
boolean |
removeLast(short e)
Removes the last found element in the queue
|
short |
removeShort(int index)
A Type-Specific remove function to reduce (un)boxing
|
boolean |
remShort(short e)
A Type-Specific implementation of remove.
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Short> o)
Deprecated.
|
void |
replaceShorts(java.util.function.IntUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(ShortCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(ShortCollection c,
ShortConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
short |
set(int index,
short e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
ShortSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
short |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveShort(short e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
short[] |
toShortArray(short[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toShortArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toShortArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, iterator, limit, map, peek, pour, pourAsList, pourAsSet, repeat, sortedisEmpty, topadd, addElements, addElements, addIfAbsent, addIfPresent, get, getElements, remove, remove, set, sort, sort, synchronize, synchronize, unmodifiable, unstableSort, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, pour, toShortArrayofpublic ShortLinkedList()
@Deprecated public ShortLinkedList(java.util.Collection<? extends java.lang.Short> c)
c - the elements that should be added into the listpublic ShortLinkedList(ShortCollection c)
c - the elements that should be added into the listpublic ShortLinkedList(ShortList l)
l - the elements that should be added into the listpublic ShortLinkedList(short... a)
a - the array that should be copiedpublic ShortLinkedList(short[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic ShortLinkedList(short[] 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(short e)
AbstractShortListList.add(int, Object)add in interface ShortCollectionadd in interface ShortListadd in class AbstractShortListe - the element to addList.add(Object)public void add(int index,
short e)
ShortListpublic boolean addAll(int index,
ShortCollection c)
ShortListpublic boolean addAll(int index,
ShortList c)
ShortList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Short> c)
addAll in interface java.util.List<java.lang.Short>public void enqueue(short e)
ShortPriorityQueueenqueue in interface ShortPriorityQueuee - the element that should be insertedpublic void enqueueFirst(short e)
ShortPriorityDequeueenqueueFirst in interface ShortPriorityDequeuee - the element that should be inserted into the first placepublic void push(short e)
ShortStackpush in interface ShortStacke - the Object to insertStack.push(Object)public boolean addAll(short[] e,
int offset,
int length)
ShortCollectionaddAll in interface ShortCollectione - 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,
short[] a,
int offset,
int length)
ShortListaddElements in interface ShortListfrom - 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 short[] getElements(int from,
short[] a,
int offset,
int length)
ShortListgetElements in interface ShortListfrom - 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 short first()
ShortPriorityQueuefirst in interface ShortPriorityQueuepublic short last()
ShortPriorityDequeuelast in interface ShortPriorityDequeuepublic short peek(int index)
ShortPriorityQueuepeek in interface ShortStackpeek in interface ShortPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public short getShort(int index)
ShortList@Deprecated public boolean contains(java.lang.Object e)
AbstractShortCollectionThis 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.Short>contains in interface java.util.List<java.lang.Short>contains in interface ShortCollectioncontains in interface ShortListcontains in class AbstractShortCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractShortListindexOf in interface java.util.List<java.lang.Short>indexOf in interface ShortListindexOf in class AbstractShortListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractShortListlastIndexOf in interface java.util.List<java.lang.Short>lastIndexOf in interface ShortListlastIndexOf in class AbstractShortListo - the value that the index is searched for.public boolean contains(short e)
AbstractShortCollectioncontains in interface ShortCollectioncontains in class AbstractShortCollectione - the element that should be searched for.public int indexOf(short e)
AbstractShortListindexOf in interface ShortListindexOf in class AbstractShortListe - the value that the index is searched for.public int lastIndexOf(short e)
AbstractShortListlastIndexOf in interface ShortListlastIndexOf in class AbstractShortListe - the value that the index is searched for.public ShortListIterator listIterator(int index)
ShortListlistIterator in interface java.util.List<java.lang.Short>listIterator in interface ShortListlistIterator in class AbstractShortListList.listIterator(int)public java.util.stream.IntStream primitiveStream()
primitiveStream in interface ShortCollectionpublic java.util.stream.IntStream parallelPrimitiveStream()
parallelPrimitiveStream in interface ShortCollectionpublic ShortSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Short>spliterator in interface java.util.Collection<java.lang.Short>spliterator in interface java.util.List<java.lang.Short>spliterator in interface ShortCollectionspliterator in interface ShortIterablespliterator in interface ShortListpublic void forEach(ShortConsumer action)
ShortIterableforEach in interface ShortIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntShortConsumer action)
ShortIterableforEachIndexed in interface ShortIterableforEachIndexed in interface ShortListaction - The action to be performed for each elementpublic <E> void forEach(E input,
ObjectShortConsumer<E> action)
ShortIterableforEach in interface ShortIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(ShortPredicate filter)
ShortIterablematchesAny in interface ShortIterablefilter - that should be appliedpublic boolean matchesNone(ShortPredicate filter)
ShortIterablematchesNone in interface ShortIterablefilter - that should be appliedpublic boolean matchesAll(ShortPredicate filter)
ShortIterablematchesAll in interface ShortIterablefilter - that should be appliedpublic short findFirst(ShortPredicate filter)
ShortIterablefindFirst in interface ShortIterablefilter - that should be appliedpublic short reduce(short identity,
ShortShortUnaryOperator operator)
ShortIterablereduce in interface ShortIterableidentity - the start valueoperator - the operation that should be appliedpublic short reduce(ShortShortUnaryOperator operator)
ShortIterablereduce in interface ShortIterableoperator - the operation that should be appliedpublic int count(ShortPredicate filter)
ShortIterablecount in interface ShortIterablefilter - that should be appliedpublic short set(int index,
short e)
ShortList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Short> o)
ShortListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Short>replaceAll in interface ShortListpublic void replaceShorts(java.util.function.IntUnaryOperator o)
ShortListreplaceShorts in interface ShortListo - the action to replace the valuespublic void onChanged()
ShortPriorityQueueonChanged in interface ShortPriorityQueuepublic ShortComparator comparator()
comparator in interface ShortPriorityQueuepublic short dequeue()
ShortPriorityQueuedequeue in interface ShortPriorityQueuepublic short dequeueLast()
ShortPriorityDequeuedequeueLast in interface ShortPriorityDequeuepublic short pop()
ShortStackpop in interface ShortStackStack.pop()public boolean removeFirst(short e)
ShortPriorityQueueremoveFirst in interface ShortPriorityQueuee - the element that should be removedpublic boolean removeLast(short e)
ShortPriorityQueueremoveLast in interface ShortPriorityQueuee - the element that should be removedpublic short swapRemove(int index)
ShortListswapRemove in interface ShortListindex - the index of the element to be removedpublic boolean swapRemoveShort(short e)
ShortListswapRemoveShort in interface ShortListswapRemoveShort in class AbstractShortListe - the element that should be removedpublic boolean remShort(short e)
AbstractShortCollectionremShort in interface ShortCollectionremShort in class AbstractShortCollectione - the element that is searched forCollection.remove(Object)public short removeShort(int index)
ShortListremoveShort in interface ShortListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
ShortListremoveElements in interface ShortListfrom - 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 short[] extractElements(int from,
int to)
ShortListextractElements in interface ShortListfrom - 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.ShortBuffer buffer)
ShortListfillBuffer in interface ShortListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Short>removeAll in interface java.util.List<java.lang.Short>removeAll in class java.util.AbstractCollection<java.lang.Short>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Short>retainAll in interface java.util.List<java.lang.Short>retainAll in class java.util.AbstractCollection<java.lang.Short>public boolean removeAll(ShortCollection c)
AbstractShortCollectionremoveAll in interface ShortCollectionremoveAll in class AbstractShortCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(ShortCollection c, ShortConsumer r)
ShortCollectionremoveAll in interface ShortCollectionremoveAll in class AbstractShortCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(ShortCollection c)
AbstractShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(ShortCollection c, ShortConsumer r)
ShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - 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.Short> filter)
ShortCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Short>removeIf in interface ShortCollectionpublic boolean remIf(java.util.function.IntPredicate filter)
ShortCollectionRemoves elements that were selected by the filter
remIf in interface ShortCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Short>toArray in interface java.util.List<java.lang.Short>toArray in class java.util.AbstractCollection<java.lang.Short>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Short>toArray in interface java.util.List<java.lang.Short>toArray in class java.util.AbstractCollection<java.lang.Short>public short[] toShortArray(short[] a)
AbstractShortCollectiontoShortArray in interface ShortCollectiontoShortArray in interface ShortPriorityQueuetoShortArray in class AbstractShortCollectiona - 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()
ShortStacksize in interface java.util.Collection<java.lang.Short>size in interface java.util.List<java.lang.Short>size in interface ShortStacksize in interface ShortPriorityQueuesize in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Short>public void clear()
ShortPriorityQueueclear in interface java.util.Collection<java.lang.Short>clear in interface java.util.List<java.lang.Short>clear in interface ShortStackclear in interface ShortPriorityQueueclear in class java.util.AbstractCollection<java.lang.Short>public ShortLinkedList copy()
ShortCollectioncopy in interface ShortCollectioncopy in interface ShortListcopy in interface ShortPriorityDequeuecopy in interface ShortPriorityQueuecopy in class AbstractShortList