public class ImmutableByteList extends AbstractByteList
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ImmutableByteList(byte... a)
Creates a new Immutable copy of the contents of the Array.
|
ImmutableByteList(byte[] a,
int length)
Creates a new ImmutableList copy of the array with a custom length
|
ImmutableByteList(byte[] a,
int offset,
int length)
Creates a new ImmutableList copy of the array with in the custom range.
|
ImmutableByteList(ByteCollection c)
Creates a new Immutable copy of the contents of the Collection.
|
ImmutableByteList(ByteList l)
Creates a new Immutable copy of the contents of the List.
|
ImmutableByteList(java.util.Collection<? extends java.lang.Byte> c)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(byte e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
byte e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(byte[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
boolean |
addAll(int index,
ByteCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
ByteList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Byte> c)
Deprecated.
|
void |
addElements(int from,
byte[] a,
int offset,
int length)
A function to fast add elements to the list
|
void |
clear() |
boolean |
contains(byte e)
A Type Specific implementation of the Collection#contains function.
|
boolean |
contains(java.lang.Object o)
Deprecated.
|
ImmutableByteList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(BytePredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
byte[] |
extractElements(int from,
int to)
A function to fast extract elements out of the list, this removes the elements that were fetched.
|
byte |
findFirst(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
void |
forEach(ByteConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectByteConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
byte |
getByte(int index)
A Type-Specific get function to reduce (un)boxing
|
byte[] |
getElements(int from,
byte[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
int |
indexOf(byte e)
A Type-Specific function to find the index of a given element
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
int |
lastIndexOf(byte e)
A Type-Specific function to find the last index of a given element
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
ByteListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(BytePredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(BytePredicate 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.
|
byte |
reduce(byte identity,
ByteByteUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
byte |
reduce(ByteByteUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remByte(byte type)
A Type-Specific implementation of remove.
|
boolean |
remIf(java.util.function.IntPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
removeAll(ByteCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(ByteCollection c,
ByteConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
byte |
removeByte(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 |
removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
Deprecated.
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Byte> o)
Deprecated.
|
void |
replaceBytes(java.util.function.IntUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(ByteCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(ByteCollection c,
ByteConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
byte |
set(int index,
byte 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(ByteComparator c)
Sorts the elements specified by the Natural order either by using the Comparator or the elements
|
ByteSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
byte |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
byte[] |
toByteArray(byte[] a)
A Type-Specific implementation of toArray.
|
void |
unstableSort(ByteComparator 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, swapRemoveByteadd, containsAll, containsAll, containsAny, containsAny, remove, toByteArrayadd, addElements, addElements, addIfAbsent, addIfPresent, fillBuffer, forEachIndexed, get, getElements, remove, remove, set, sort, synchronize, synchronize, unmodifiable, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, toByteArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedof@Deprecated public ImmutableByteList(java.util.Collection<? extends java.lang.Byte> c)
c - the elements that should be added into the listpublic ImmutableByteList(ByteCollection c)
c - the elements that should be added into the listpublic ImmutableByteList(ByteList l)
l - the elements that should be added into the listpublic ImmutableByteList(byte... a)
a - the array that should be copiedpublic ImmutableByteList(byte[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic ImmutableByteList(byte[] 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(byte e)
AbstractByteListList.add(int, Object)add in interface ByteCollectionadd in interface ByteListadd in class AbstractByteListe - the element to addList.add(Object)public void add(int index,
byte e)
ByteListindex - 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.Byte> c)
public boolean addAll(int index,
ByteCollection c)
ByteListindex - 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,
ByteList c)
ByteListindex - index at which the specified elements is to be insertedc - the elements that need to be addedpublic boolean addAll(byte[] e,
int offset,
int length)
ByteCollectione - 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,
byte[] a,
int offset,
int length)
ByteListfrom - 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 byte[] getElements(int from,
byte[] a,
int offset,
int length)
ByteListfrom - 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)
ByteListfrom - 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 byte[] extractElements(int from,
int to)
ByteListfrom - 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.Byte>contains in interface java.util.List<java.lang.Byte>contains in interface ByteCollectioncontains in interface ByteListcontains in class AbstractByteCollectiono - the element that is searched for@Deprecated public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<java.lang.Byte>indexOf in interface ByteListindexOf in class AbstractByteListo - the element that is searched for@Deprecated public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<java.lang.Byte>lastIndexOf in interface ByteListlastIndexOf in class AbstractByteListo - the element that is searched forpublic boolean contains(byte e)
contains in interface ByteCollectioncontains in class AbstractByteCollectione - the element that is searched for.public int indexOf(byte e)
indexOf in interface ByteListindexOf in class AbstractByteListe - the element that is searched forpublic int lastIndexOf(byte e)
lastIndexOf in interface ByteListlastIndexOf in class AbstractByteListe - the element that is searched forpublic void sort(ByteComparator c)
ByteListc - the sorter of the elements, can be nullList.sort(Comparator),
ByteArrays.stableSort(byte[], ByteComparator)public void unstableSort(ByteComparator c)
ByteListc - the sorter of the elements, can be nullList.sort(Comparator),
ByteArrays.unstableSort(byte[], ByteComparator)public byte getByte(int index)
index - the index of the element to fetchjava.lang.IndexOutOfBoundsException - if the index is out of rangeList.get(int)public ImmutableByteList copy()
ByteCollectioncopy in interface ByteCollectioncopy in interface ByteListcopy in class AbstractByteListpublic void forEach(ByteConsumer 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,
ObjectByteConsumer<E> action)
ByteIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(BytePredicate filter)
ByteIterablefilter - that should be appliedpublic boolean matchesNone(BytePredicate filter)
ByteIterablefilter - that should be appliedpublic boolean matchesAll(BytePredicate filter)
ByteIterablefilter - that should be appliedpublic byte findFirst(BytePredicate filter)
ByteIterablefilter - that should be appliedpublic byte reduce(byte identity,
ByteByteUnaryOperator operator)
ByteIterableidentity - the start valueoperator - the operation that should be appliedpublic byte reduce(ByteByteUnaryOperator operator)
ByteIterableoperator - the operation that should be appliedpublic int count(BytePredicate filter)
ByteIterablefilter - that should be appliedpublic ByteListIterator listIterator(int index)
ByteListlistIterator in interface java.util.List<java.lang.Byte>listIterator in interface ByteListlistIterator in class AbstractByteListList.listIterator(int)public byte set(int index,
byte e)
ByteListindex - 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.Byte> o)
ByteListThis default implementation delegates to the corresponding type-specific function.
public void replaceBytes(java.util.function.IntUnaryOperator o)
ByteListo - the action to replace the valuespublic byte removeByte(int index)
ByteListindex - the index of the element to be removedList.remove(int)public byte swapRemove(int index)
ByteListindex - the index of the element to be removedpublic boolean remByte(byte type)
AbstractByteCollectionremByte in interface ByteCollectionremByte in class AbstractByteCollectiontype - the element that is searched forCollection.remove(Object)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Byte>removeAll in interface java.util.List<java.lang.Byte>removeAll in class java.util.AbstractCollection<java.lang.Byte>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Byte>retainAll in interface java.util.List<java.lang.Byte>retainAll in class java.util.AbstractCollection<java.lang.Byte>@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
ByteCollectionThis default implementation delegates to the corresponding type-specific function.
public boolean removeAll(ByteCollection c)
AbstractByteCollectionremoveAll in interface ByteCollectionremoveAll in class AbstractByteCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(ByteCollection c)
AbstractByteCollectionretainAll in interface ByteCollectionretainAll in class AbstractByteCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean removeAll(ByteCollection c, ByteConsumer r)
ByteCollectionremoveAll in interface ByteCollectionremoveAll in class AbstractByteCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(ByteCollection c, ByteConsumer r)
ByteCollectionretainAll in interface ByteCollectionretainAll in class AbstractByteCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)public boolean remIf(java.util.function.IntPredicate filter)
ByteCollectionRemoves 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.Byte>toArray in interface java.util.List<java.lang.Byte>toArray in class java.util.AbstractCollection<java.lang.Byte>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Byte>toArray in interface java.util.List<java.lang.Byte>toArray in class java.util.AbstractCollection<java.lang.Byte>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 byte[] toByteArray(byte[] a)
AbstractByteCollectiontoByteArray in interface ByteCollectiontoByteArray in class AbstractByteCollectiona - 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.Byte>size in interface java.util.List<java.lang.Byte>size in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Byte>public void size(int size)
ByteListsize in interface ByteListsize in class AbstractByteListsize - the requested amount of elements/room for elementspublic void clear()
clear in interface java.util.Collection<java.lang.Byte>clear in interface java.util.List<java.lang.Byte>clear in class java.util.AbstractCollection<java.lang.Byte>public java.util.stream.IntStream primitiveStream()
public ByteSplititerator spliterator()