public class ByteLinkedList extends AbstractByteList implements BytePriorityDequeue, ByteStack
This implementation is optimized to improve how data is processed with interfaces like ByteStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
| Constructor and Description |
|---|
ByteLinkedList()
Creates a new LinkedList.
|
ByteLinkedList(byte... a)
Creates a new LinkedList with a Copy of the array
|
ByteLinkedList(byte[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
ByteLinkedList(byte[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
ByteLinkedList(ByteCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
ByteLinkedList(ByteList l)
Creates a new LinkedList a copy with the contents of the List.
|
ByteLinkedList(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()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
ByteComparator |
comparator() |
boolean |
contains(byte e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
ByteLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Byte2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
byte |
dequeue()
Method to extract a element from the PriorityQueue
|
byte |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(byte e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(byte e)
Method to insert a element into the first Index instead of the last.
|
byte[] |
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.ByteBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
byte |
findFirst(Byte2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
byte |
first()
Shows the element that is to be returned next
|
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)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
byte |
last()
Peeking function for the last element
|
int |
lastIndexOf(byte e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
ByteListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(Byte2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Byte2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Byte2BooleanFunction 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.
|
byte |
peek(int index)
Peeking function to see whats inside the queue.
|
byte |
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(byte e)
Inserts a given Object on top of the stack
|
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 e)
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 |
removeFirst(byte e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
Deprecated.
|
boolean |
removeLast(byte e)
Removes the last found element in the queue
|
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()
Provides the amount of elements currently in the stack
|
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.
|
boolean |
swapRemoveByte(byte e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
byte[] |
toByteArray(byte[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toByteArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toByteArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, iterator, limit, map, peek, pour, pourAsList, pourAsSet, sortedadd, addElements, addElements, addIfAbsent, addIfPresent, get, getElements, remove, remove, set, sort, sort, synchronize, synchronize, unmodifiable, unstableSort, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, pour, toByteArraypublic ByteLinkedList()
@Deprecated public ByteLinkedList(java.util.Collection<? extends java.lang.Byte> c)
c - the elements that should be added into the listpublic ByteLinkedList(ByteCollection c)
c - the elements that should be added into the listpublic ByteLinkedList(ByteList l)
l - the elements that should be added into the listpublic ByteLinkedList(byte... a)
a - the array that should be copiedpublic ByteLinkedList(byte[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic ByteLinkedList(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)
ByteListpublic boolean addAll(int index,
ByteCollection c)
ByteListpublic boolean addAll(int index,
ByteList c)
ByteList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Byte> c)
addAll in interface java.util.List<java.lang.Byte>public void enqueue(byte e)
BytePriorityQueueenqueue in interface BytePriorityQueuee - the element that should be insertedpublic void enqueueFirst(byte e)
BytePriorityDequeueenqueueFirst in interface BytePriorityDequeuee - the element that should be inserted into the first placepublic void push(byte e)
ByteStackpush in interface ByteStacke - the Object to insertStack.push(Object)public boolean addAll(byte[] e,
int offset,
int length)
ByteCollectionaddAll in interface 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)
ByteListaddElements in interface 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)
ByteListgetElements in interface 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 byte first()
BytePriorityQueuefirst in interface BytePriorityQueuepublic byte last()
BytePriorityDequeuelast in interface BytePriorityDequeuepublic byte peek(int index)
BytePriorityQueuepeek in interface ByteStackpeek in interface BytePriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public byte getByte(int index)
ByteList@Deprecated public boolean contains(java.lang.Object e)
AbstractByteCollectionThis 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.Byte>contains in interface java.util.List<java.lang.Byte>contains in interface ByteCollectioncontains in interface ByteListcontains in class AbstractByteCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractByteListindexOf in interface java.util.List<java.lang.Byte>indexOf in interface ByteListindexOf in class AbstractByteListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractByteListlastIndexOf in interface java.util.List<java.lang.Byte>lastIndexOf in interface ByteListlastIndexOf in class AbstractByteListo - the value that the index is searched for.public boolean contains(byte e)
AbstractByteCollectioncontains in interface ByteCollectioncontains in class AbstractByteCollectione - the element that should be searched for.public int indexOf(byte e)
AbstractByteListindexOf in interface ByteListindexOf in class AbstractByteListe - the value that the index is searched for.public int lastIndexOf(byte e)
AbstractByteListlastIndexOf in interface ByteListlastIndexOf in class AbstractByteListe - the value that the index is searched for.public ByteListIterator listIterator(int index)
ByteListlistIterator in interface java.util.List<java.lang.Byte>listIterator in interface ByteListlistIterator in class AbstractByteListList.listIterator(int)public java.util.stream.IntStream primitiveStream()
primitiveStream in interface ByteCollectionpublic java.util.stream.IntStream parallelPrimitiveStream()
parallelPrimitiveStream in interface ByteCollectionpublic ByteSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Byte>spliterator in interface java.util.Collection<java.lang.Byte>spliterator in interface java.util.List<java.lang.Byte>spliterator in interface ByteCollectionspliterator in interface ByteIterablespliterator in interface ByteListpublic void forEach(ByteConsumer action)
ByteIterableforEach in interface ByteIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectByteConsumer<E> action)
ByteIterableforEach in interface ByteIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Byte2BooleanFunction filter)
ByteIterablematchesAny in interface ByteIterablefilter - that should be appliedpublic boolean matchesNone(Byte2BooleanFunction filter)
ByteIterablematchesNone in interface ByteIterablefilter - that should be appliedpublic boolean matchesAll(Byte2BooleanFunction filter)
ByteIterablematchesAll in interface ByteIterablefilter - that should be appliedpublic byte findFirst(Byte2BooleanFunction filter)
ByteIterablefindFirst in interface ByteIterablefilter - that should be appliedpublic byte reduce(byte identity,
ByteByteUnaryOperator operator)
ByteIterablereduce in interface ByteIterableidentity - the start valueoperator - the operation that should be appliedpublic byte reduce(ByteByteUnaryOperator operator)
ByteIterablereduce in interface ByteIterableoperator - the operation that should be appliedpublic int count(Byte2BooleanFunction filter)
ByteIterablecount in interface ByteIterablefilter - that should be appliedpublic byte set(int index,
byte e)
ByteList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Byte> o)
ByteListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Byte>replaceAll in interface ByteListpublic void replaceBytes(java.util.function.IntUnaryOperator o)
ByteListreplaceBytes in interface ByteListo - the action to replace the valuespublic void onChanged()
BytePriorityQueueonChanged in interface BytePriorityQueuepublic ByteComparator comparator()
comparator in interface BytePriorityQueuepublic byte dequeue()
BytePriorityQueuedequeue in interface BytePriorityQueuepublic byte dequeueLast()
BytePriorityDequeuedequeueLast in interface BytePriorityDequeuepublic byte pop()
ByteStackpop in interface ByteStackStack.pop()public boolean removeFirst(byte e)
BytePriorityQueueremoveFirst in interface BytePriorityQueuee - the element that should be removedpublic boolean removeLast(byte e)
BytePriorityQueueremoveLast in interface BytePriorityQueuee - the element that should be removedpublic byte swapRemove(int index)
ByteListswapRemove in interface ByteListindex - the index of the element to be removedpublic boolean swapRemoveByte(byte e)
ByteListswapRemoveByte in interface ByteListswapRemoveByte in class AbstractByteListe - the element that should be removedpublic boolean remByte(byte e)
AbstractByteCollectionremByte in interface ByteCollectionremByte in class AbstractByteCollectione - the element that is searched forCollection.remove(Object)public byte removeByte(int index)
ByteListremoveByte in interface ByteListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
ByteListremoveElements in interface 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)
ByteListextractElements in interface 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)public void fillBuffer(java.nio.ByteBuffer buffer)
ByteListfillBuffer in interface ByteListbuffer - where the data should be stored in.@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>public boolean removeAll(ByteCollection c)
AbstractByteCollectionremoveAll in interface ByteCollectionremoveAll in class AbstractByteCollectionc - the elements that should be deletedCollection.removeAll(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)
AbstractByteCollectionretainAll in interface ByteCollectionretainAll in class AbstractByteCollectionc - the elements that should be keptCollection.retainAll(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)@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
ByteCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Byte>removeIf in interface ByteCollectionpublic boolean remIf(java.util.function.IntPredicate filter)
ByteCollectionRemoves elements that were selected by the filter
remIf in interface ByteCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)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>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>public byte[] toByteArray(byte[] a)
AbstractByteCollectiontoByteArray in interface ByteCollectiontoByteArray in interface BytePriorityQueuetoByteArray 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()
ByteStacksize in interface java.util.Collection<java.lang.Byte>size in interface java.util.List<java.lang.Byte>size in interface ByteStacksize in interface BytePriorityQueuesize in class java.util.AbstractCollection<java.lang.Byte>public void clear()
BytePriorityQueueclear in interface java.util.Collection<java.lang.Byte>clear in interface java.util.List<java.lang.Byte>clear in interface ByteStackclear in interface BytePriorityQueueclear in class java.util.AbstractCollection<java.lang.Byte>public ByteLinkedList copy()
ByteCollectioncopy in interface ByteCollectioncopy in interface ByteListcopy in interface BytePriorityDequeuecopy in interface BytePriorityQueuecopy in class AbstractByteList