public class CharLinkedList extends AbstractCharList implements CharPriorityDequeue, CharStack
This implementation is optimized to improve how data is processed with interfaces like CharStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
| Constructor and Description |
|---|
CharLinkedList()
Creates a new LinkedList.
|
CharLinkedList(char... a)
Creates a new LinkedList with a Copy of the array
|
CharLinkedList(char[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
CharLinkedList(char[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
CharLinkedList(CharCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
CharLinkedList(CharList l)
Creates a new LinkedList a copy with the contents of the List.
|
CharLinkedList(java.util.Collection<? extends java.lang.Character> c)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
char e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(char[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
boolean |
addAll(int index,
CharCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
CharList 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.Character> c)
Deprecated.
|
void |
addElements(int from,
char[] 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
|
CharComparator |
comparator() |
boolean |
contains(char e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
CharLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
char |
dequeue()
Method to extract a element from the PriorityQueue
|
char |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(char e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(char e)
Method to insert a element into the first Index instead of the last.
|
char[] |
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.CharBuffer buffer)
Helper function that allows to fastFill a buffer reducing the duplication requirement
|
char |
findFirst(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
char |
first()
Shows the element that is to be returned next
|
void |
forEach(CharConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectCharConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
char |
getChar(int index)
A Type-Specific get function to reduce (un)boxing
|
char[] |
getElements(int from,
char[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
int |
indexOf(char e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
char |
last()
Peeking function for the last element
|
int |
lastIndexOf(char e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
CharListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Char2BooleanFunction 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.
|
char |
peek(int index)
Peeking function to see whats inside the queue.
|
char |
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(char e)
Inserts a given Object on top of the stack
|
char |
reduce(char identity,
CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
char |
reduce(CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remChar(char 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(CharCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(CharCollection c,
CharConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
char |
removeChar(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(char e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Character> filter)
Deprecated.
|
boolean |
removeLast(char e)
Removes the last found element in the queue
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Character> o)
Deprecated.
|
void |
replaceChars(java.util.function.IntUnaryOperator o)
A Type-Specific replace function to reduce (un)boxing
|
boolean |
retainAll(CharCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(CharCollection c,
CharConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
char |
set(int index,
char e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
CharSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
char |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveChar(char e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
char[] |
toCharArray(char[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toCharArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toCharArrayarrayflatMap, 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, toCharArraypublic CharLinkedList()
@Deprecated public CharLinkedList(java.util.Collection<? extends java.lang.Character> c)
c - the elements that should be added into the listpublic CharLinkedList(CharCollection c)
c - the elements that should be added into the listpublic CharLinkedList(CharList l)
l - the elements that should be added into the listpublic CharLinkedList(char... a)
a - the array that should be copiedpublic CharLinkedList(char[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic CharLinkedList(char[] 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(char e)
AbstractCharListList.add(int, Object)add in interface CharCollectionadd in interface CharListadd in class AbstractCharListe - the element to addList.add(Object)public void add(int index,
char e)
CharListpublic boolean addAll(int index,
CharCollection c)
CharListpublic boolean addAll(int index,
CharList c)
CharList@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Character> c)
addAll in interface java.util.List<java.lang.Character>public void enqueue(char e)
CharPriorityQueueenqueue in interface CharPriorityQueuee - the element that should be insertedpublic void enqueueFirst(char e)
CharPriorityDequeueenqueueFirst in interface CharPriorityDequeuee - the element that should be inserted into the first placepublic void push(char e)
CharStackpush in interface CharStacke - the Object to insertStack.push(Object)public boolean addAll(char[] e,
int offset,
int length)
CharCollectionaddAll in interface CharCollectione - 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,
char[] a,
int offset,
int length)
CharListaddElements in interface CharListfrom - 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 char[] getElements(int from,
char[] a,
int offset,
int length)
CharListgetElements in interface CharListfrom - 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 char first()
CharPriorityQueuefirst in interface CharPriorityQueuepublic char last()
CharPriorityDequeuelast in interface CharPriorityDequeuepublic char peek(int index)
CharPriorityQueuepeek in interface CharStackpeek in interface CharPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public char getChar(int index)
CharList@Deprecated public boolean contains(java.lang.Object e)
AbstractCharCollectionThis 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.Character>contains in interface java.util.List<java.lang.Character>contains in interface CharCollectioncontains in interface CharListcontains in class AbstractCharCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractCharListindexOf in interface java.util.List<java.lang.Character>indexOf in interface CharListindexOf in class AbstractCharListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractCharListlastIndexOf in interface java.util.List<java.lang.Character>lastIndexOf in interface CharListlastIndexOf in class AbstractCharListo - the value that the index is searched for.public boolean contains(char e)
AbstractCharCollectioncontains in interface CharCollectioncontains in class AbstractCharCollectione - the element that should be searched for.public int indexOf(char e)
AbstractCharListindexOf in interface CharListindexOf in class AbstractCharListe - the value that the index is searched for.public int lastIndexOf(char e)
AbstractCharListlastIndexOf in interface CharListlastIndexOf in class AbstractCharListe - the value that the index is searched for.public CharListIterator listIterator(int index)
CharListlistIterator in interface java.util.List<java.lang.Character>listIterator in interface CharListlistIterator in class AbstractCharListList.listIterator(int)public java.util.stream.IntStream primitiveStream()
primitiveStream in interface CharCollectionpublic java.util.stream.IntStream parallelPrimitiveStream()
parallelPrimitiveStream in interface CharCollectionpublic CharSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Character>spliterator in interface java.util.Collection<java.lang.Character>spliterator in interface java.util.List<java.lang.Character>spliterator in interface CharCollectionspliterator in interface CharIterablespliterator in interface CharListpublic void forEach(CharConsumer action)
CharIterableforEach in interface CharIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectCharConsumer<E> action)
CharIterableforEach in interface CharIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Char2BooleanFunction filter)
CharIterablematchesAny in interface CharIterablefilter - that should be appliedpublic boolean matchesNone(Char2BooleanFunction filter)
CharIterablematchesNone in interface CharIterablefilter - that should be appliedpublic boolean matchesAll(Char2BooleanFunction filter)
CharIterablematchesAll in interface CharIterablefilter - that should be appliedpublic char findFirst(Char2BooleanFunction filter)
CharIterablefindFirst in interface CharIterablefilter - that should be appliedpublic char reduce(char identity,
CharCharUnaryOperator operator)
CharIterablereduce in interface CharIterableidentity - the start valueoperator - the operation that should be appliedpublic char reduce(CharCharUnaryOperator operator)
CharIterablereduce in interface CharIterableoperator - the operation that should be appliedpublic int count(Char2BooleanFunction filter)
CharIterablecount in interface CharIterablefilter - that should be appliedpublic char set(int index,
char e)
CharList@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Character> o)
CharListThis default implementation delegates to the corresponding type-specific function.
replaceAll in interface java.util.List<java.lang.Character>replaceAll in interface CharListpublic void replaceChars(java.util.function.IntUnaryOperator o)
CharListreplaceChars in interface CharListo - the action to replace the valuespublic void onChanged()
CharPriorityQueueonChanged in interface CharPriorityQueuepublic CharComparator comparator()
comparator in interface CharPriorityQueuepublic char dequeue()
CharPriorityQueuedequeue in interface CharPriorityQueuepublic char dequeueLast()
CharPriorityDequeuedequeueLast in interface CharPriorityDequeuepublic char pop()
CharStackpop in interface CharStackStack.pop()public boolean removeFirst(char e)
CharPriorityQueueremoveFirst in interface CharPriorityQueuee - the element that should be removedpublic boolean removeLast(char e)
CharPriorityQueueremoveLast in interface CharPriorityQueuee - the element that should be removedpublic char swapRemove(int index)
CharListswapRemove in interface CharListindex - the index of the element to be removedpublic boolean swapRemoveChar(char e)
CharListswapRemoveChar in interface CharListswapRemoveChar in class AbstractCharListe - the element that should be removedpublic boolean remChar(char e)
AbstractCharCollectionremChar in interface CharCollectionremChar in class AbstractCharCollectione - the element that is searched forCollection.remove(Object)public char removeChar(int index)
CharListremoveChar in interface CharListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
CharListremoveElements in interface CharListfrom - 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 char[] extractElements(int from,
int to)
CharListextractElements in interface CharListfrom - 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.CharBuffer buffer)
CharListfillBuffer in interface CharListbuffer - where the data should be stored in.@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Character>removeAll in interface java.util.List<java.lang.Character>removeAll in class java.util.AbstractCollection<java.lang.Character>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Character>retainAll in interface java.util.List<java.lang.Character>retainAll in class java.util.AbstractCollection<java.lang.Character>public boolean removeAll(CharCollection c)
AbstractCharCollectionremoveAll in interface CharCollectionremoveAll in class AbstractCharCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(CharCollection c, CharConsumer r)
CharCollectionremoveAll in interface CharCollectionremoveAll in class AbstractCharCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(CharCollection c)
AbstractCharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(CharCollection c, CharConsumer r)
CharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - 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.Character> filter)
CharCollectionThis default implementation delegates to the corresponding type-specific function.
removeIf in interface java.util.Collection<java.lang.Character>removeIf in interface CharCollectionpublic boolean remIf(java.util.function.IntPredicate filter)
CharCollectionRemoves elements that were selected by the filter
remIf in interface CharCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Character>toArray in interface java.util.List<java.lang.Character>toArray in class java.util.AbstractCollection<java.lang.Character>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Character>toArray in interface java.util.List<java.lang.Character>toArray in class java.util.AbstractCollection<java.lang.Character>public char[] toCharArray(char[] a)
AbstractCharCollectiontoCharArray in interface CharCollectiontoCharArray in interface CharPriorityQueuetoCharArray in class AbstractCharCollectiona - 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()
CharStacksize in interface java.util.Collection<java.lang.Character>size in interface java.util.List<java.lang.Character>size in interface CharStacksize in interface CharPriorityQueuesize in class java.util.AbstractCollection<java.lang.Character>public void clear()
CharPriorityQueueclear in interface java.util.Collection<java.lang.Character>clear in interface java.util.List<java.lang.Character>clear in interface CharStackclear in interface CharPriorityQueueclear in class java.util.AbstractCollection<java.lang.Character>public CharLinkedList copy()
CharCollectioncopy in interface CharCollectioncopy in interface CharListcopy in interface CharPriorityDequeuecopy in interface CharPriorityQueuecopy in class AbstractCharList