public class ImmutableShortList extends AbstractShortList
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ImmutableShortList(java.util.Collection<? extends java.lang.Short> c)
Deprecated.
|
ImmutableShortList(short... a)
Creates a new Immutable copy of the contents of the Array.
|
ImmutableShortList(short[] a,
int length)
Creates a new ImmutableList copy of the array with a custom length
|
ImmutableShortList(short[] a,
int offset,
int length)
Creates a new ImmutableList copy of the array with in the custom range.
|
ImmutableShortList(ShortCollection c)
Creates a new Immutable copy of the contents of the Collection.
|
ImmutableShortList(ShortList l)
Creates a new Immutable copy of 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() |
boolean |
contains(java.lang.Object o)
Deprecated.
|
boolean |
contains(short e)
A Type Specific implementation of the Collection#contains function.
|
ImmutableShortList |
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[] |
extractElements(int from,
int to)
A function to fast extract elements out of the list, this removes the elements that were fetched.
|
short |
findFirst(ShortPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
<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
|
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)
A Type-Specific function to find the index of a given element
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
int |
lastIndexOf(short e)
A Type-Specific function to find the last index of a given element
|
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.
|
java.util.stream.IntStream |
primitiveStream()
Returns a Java-Type-Specific Stream to reduce boxing/unboxing.
|
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 |
removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
Deprecated.
|
short |
removeShort(int index)
A Type-Specific remove function to reduce (un)boxing
|
boolean |
remShort(short type)
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()
A function to return the size of the list
|
void |
size(int size)
A function to ensure the elements are within the requested size.
|
void |
sort(ShortComparator c)
Sorts the elements specified by the Natural order either by using the Comparator or the elements
|
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.
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
short[] |
toShortArray(short[] a)
A Type-Specific implementation of toArray.
|
void |
unstableSort(ShortComparator c)
Sorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, subList, swapRemoveShortadd, containsAll, containsAll, containsAny, containsAny, remove, toShortArrayadd, addElements, addElements, addIfAbsent, addIfPresent, fillBuffer, forEachIndexed, get, getElements, remove, remove, set, sort, synchronize, synchronize, unmodifiable, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, toShortArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedof@Deprecated public ImmutableShortList(java.util.Collection<? extends java.lang.Short> c)
c - the elements that should be added into the listpublic ImmutableShortList(ShortCollection c)
c - the elements that should be added into the listpublic ImmutableShortList(ShortList l)
l - the elements that should be added into the listpublic ImmutableShortList(short... a)
a - the array that should be copiedpublic ImmutableShortList(short[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic ImmutableShortList(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)
ShortListindex - index at which the specified element is to be insertede - the element to addList.add(int, Object)@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Short> c)
public boolean addAll(int index,
ShortCollection c)
ShortListindex - 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,
ShortList c)
ShortListindex - index at which the specified elements is to be insertedc - the elements that need to be addedpublic boolean addAll(short[] e,
int offset,
int length)
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)
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)
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 void removeElements(int from,
int to)
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)
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)@Deprecated public boolean contains(java.lang.Object o)
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 AbstractShortCollectiono - the element that is searched for@Deprecated public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<java.lang.Short>indexOf in interface ShortListindexOf in class AbstractShortListo - the element that is searched for@Deprecated public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<java.lang.Short>lastIndexOf in interface ShortListlastIndexOf in class AbstractShortListo - the element that is searched forpublic boolean contains(short e)
contains in interface ShortCollectioncontains in class AbstractShortCollectione - the element that is searched for.public int indexOf(short e)
indexOf in interface ShortListindexOf in class AbstractShortListe - the element that is searched forpublic int lastIndexOf(short e)
lastIndexOf in interface ShortListlastIndexOf in class AbstractShortListe - the element that is searched forpublic void sort(ShortComparator c)
ShortListc - the sorter of the elements, can be nullList.sort(Comparator),
ShortArrays.stableSort(short[], ShortComparator)public void unstableSort(ShortComparator c)
ShortListc - the sorter of the elements, can be nullList.sort(Comparator),
ShortArrays.unstableSort(short[], ShortComparator)public short getShort(int index)
index - the index of the element to fetchjava.lang.IndexOutOfBoundsException - if the index is out of rangeList.get(int)public ImmutableShortList copy()
ShortCollectioncopy in interface ShortCollectioncopy in interface ShortListcopy in class AbstractShortListpublic void forEach(ShortConsumer action)
action - The action to be performed for each elementjava.lang.NullPointerException - if the specified action is nullIterable.forEach(java.util.function.Consumer)The default implementation behaves as if:
for(int i = 0;i<size;i++)
action.accept(data[i]);
public <E> void forEach(E input,
ObjectShortConsumer<E> action)
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)
ShortIterablefilter - that should be appliedpublic boolean matchesNone(ShortPredicate filter)
ShortIterablefilter - that should be appliedpublic boolean matchesAll(ShortPredicate filter)
ShortIterablefilter - that should be appliedpublic short findFirst(ShortPredicate filter)
ShortIterablefilter - that should be appliedpublic short reduce(short identity,
ShortShortUnaryOperator operator)
ShortIterableidentity - the start valueoperator - the operation that should be appliedpublic short reduce(ShortShortUnaryOperator operator)
ShortIterableoperator - the operation that should be appliedpublic int count(ShortPredicate filter)
ShortIterablefilter - that should be appliedpublic ShortListIterator listIterator(int index)
ShortListlistIterator in interface java.util.List<java.lang.Short>listIterator in interface ShortListlistIterator in class AbstractShortListList.listIterator(int)public short set(int index,
short e)
ShortListindex - 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.Short> o)
ShortListThis default implementation delegates to the corresponding type-specific function.
public void replaceShorts(java.util.function.IntUnaryOperator o)
ShortListo - the action to replace the valuespublic short removeShort(int index)
ShortListindex - the index of the element to be removedList.remove(int)public short swapRemove(int index)
ShortListindex - the index of the element to be removedpublic boolean remShort(short type)
AbstractShortCollectionremShort in interface ShortCollectionremShort in class AbstractShortCollectiontype - the element that is searched forCollection.remove(Object)@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>@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
ShortCollectionThis default implementation delegates to the corresponding type-specific function.
public boolean removeAll(ShortCollection c)
AbstractShortCollectionremoveAll in interface ShortCollectionremoveAll in class AbstractShortCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(ShortCollection c)
AbstractShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - the elements that should be keptCollection.retainAll(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, ShortConsumer r)
ShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)public boolean remIf(java.util.function.IntPredicate filter)
ShortCollectionRemoves elements that were selected by the filter
filter - Filters the elements that should be removedCollection.removeIf(Predicate)@Deprecated 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>@Deprecated 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>a - original array. If null a Object array with the right size is created. If to small the Array of the same type is created with the right sizepublic short[] toShortArray(short[] a)
AbstractShortCollectiontoShortArray in interface ShortCollectiontoShortArray 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()
size in interface java.util.Collection<java.lang.Short>size in interface java.util.List<java.lang.Short>size in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Short>public void size(int size)
ShortListsize in interface ShortListsize in class AbstractShortListsize - the requested amount of elements/room for elementspublic void clear()
clear in interface java.util.Collection<java.lang.Short>clear in interface java.util.List<java.lang.Short>clear in class java.util.AbstractCollection<java.lang.Short>public java.util.stream.IntStream primitiveStream()
public ShortSplititerator spliterator()