public class ImmutableCharList extends AbstractCharList
ISizeProvider.CollectionSize| Constructor and Description |
|---|
ImmutableCharList(char... a)
Creates a new Immutable copy of the contents of the Array.
|
ImmutableCharList(char[] a,
int length)
Creates a new ImmutableList copy of the array with a custom length
|
ImmutableCharList(char[] a,
int offset,
int length)
Creates a new ImmutableList copy of the array with in the custom range.
|
ImmutableCharList(CharCollection c)
Creates a new Immutable copy of the contents of the Collection.
|
ImmutableCharList(CharList l)
Creates a new Immutable copy of the contents of the List.
|
ImmutableCharList(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() |
boolean |
contains(char e)
A Type Specific implementation of the Collection#contains function.
|
boolean |
contains(java.lang.Object o)
Deprecated.
|
ImmutableCharList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(CharPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
char[] |
extractElements(int from,
int to)
A function to fast extract elements out of the list, this removes the elements that were fetched.
|
char |
findFirst(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
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)
A Type-Specific function to find the index of a given element
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
int |
lastIndexOf(char e)
A Type-Specific function to find the last index of a given element
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
CharListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(CharPredicate 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.
|
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 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(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 |
removeIf(java.util.function.Predicate<? super java.lang.Character> filter)
Deprecated.
|
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()
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(CharComparator c)
Sorts the elements specified by the Natural order either by using the Comparator or the elements
|
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.
|
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
char[] |
toCharArray(char[] a)
A Type-Specific implementation of toArray.
|
void |
unstableSort(CharComparator 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, swapRemoveCharadd, containsAll, containsAll, containsAny, containsAny, remove, toCharArrayadd, addElements, addElements, addIfAbsent, addIfPresent, fillBuffer, forEachIndexed, get, getElements, remove, remove, set, sort, synchronize, synchronize, unmodifiable, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, toCharArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedof@Deprecated public ImmutableCharList(java.util.Collection<? extends java.lang.Character> c)
c - the elements that should be added into the listpublic ImmutableCharList(CharCollection c)
c - the elements that should be added into the listpublic ImmutableCharList(CharList l)
l - the elements that should be added into the listpublic ImmutableCharList(char... a)
a - the array that should be copiedpublic ImmutableCharList(char[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic ImmutableCharList(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)
CharListindex - 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.Character> c)
public boolean addAll(int index,
CharCollection c)
CharListindex - 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,
CharList c)
CharListindex - index at which the specified elements is to be insertedc - the elements that need to be addedpublic boolean addAll(char[] e,
int offset,
int length)
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)
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)
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 void removeElements(int from,
int to)
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)
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)@Deprecated public boolean contains(java.lang.Object o)
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 AbstractCharCollectiono - the element that is searched for@Deprecated public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<java.lang.Character>indexOf in interface CharListindexOf in class AbstractCharListo - the element that is searched for@Deprecated public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<java.lang.Character>lastIndexOf in interface CharListlastIndexOf in class AbstractCharListo - the element that is searched forpublic boolean contains(char e)
contains in interface CharCollectioncontains in class AbstractCharCollectione - the element that is searched for.public int indexOf(char e)
indexOf in interface CharListindexOf in class AbstractCharListe - the element that is searched forpublic int lastIndexOf(char e)
lastIndexOf in interface CharListlastIndexOf in class AbstractCharListe - the element that is searched forpublic void sort(CharComparator c)
CharListc - the sorter of the elements, can be nullList.sort(Comparator),
CharArrays.stableSort(char[], CharComparator)public void unstableSort(CharComparator c)
CharListc - the sorter of the elements, can be nullList.sort(Comparator),
CharArrays.unstableSort(char[], CharComparator)public char getChar(int index)
index - the index of the element to fetchjava.lang.IndexOutOfBoundsException - if the index is out of rangeList.get(int)public ImmutableCharList copy()
CharCollectioncopy in interface CharCollectioncopy in interface CharListcopy in class AbstractCharListpublic void forEach(CharConsumer 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,
ObjectCharConsumer<E> action)
CharIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(CharPredicate filter)
CharIterablefilter - that should be appliedpublic boolean matchesNone(CharPredicate filter)
CharIterablefilter - that should be appliedpublic boolean matchesAll(CharPredicate filter)
CharIterablefilter - that should be appliedpublic char findFirst(CharPredicate filter)
CharIterablefilter - that should be appliedpublic char reduce(char identity,
CharCharUnaryOperator operator)
CharIterableidentity - the start valueoperator - the operation that should be appliedpublic char reduce(CharCharUnaryOperator operator)
CharIterableoperator - the operation that should be appliedpublic int count(CharPredicate filter)
CharIterablefilter - that should be appliedpublic CharListIterator listIterator(int index)
CharListlistIterator in interface java.util.List<java.lang.Character>listIterator in interface CharListlistIterator in class AbstractCharListList.listIterator(int)public char set(int index,
char e)
CharListindex - 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.Character> o)
CharListThis default implementation delegates to the corresponding type-specific function.
public void replaceChars(java.util.function.IntUnaryOperator o)
CharListo - the action to replace the valuespublic char removeChar(int index)
CharListindex - the index of the element to be removedList.remove(int)public char swapRemove(int index)
CharListindex - the index of the element to be removedpublic boolean remChar(char type)
AbstractCharCollectionremChar in interface CharCollectionremChar in class AbstractCharCollectiontype - the element that is searched forCollection.remove(Object)@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>@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Character> filter)
CharCollectionThis default implementation delegates to the corresponding type-specific function.
public boolean removeAll(CharCollection c)
AbstractCharCollectionremoveAll in interface CharCollectionremoveAll in class AbstractCharCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean retainAll(CharCollection c)
AbstractCharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - the elements that should be keptCollection.retainAll(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, CharConsumer r)
CharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)public boolean remIf(java.util.function.IntPredicate filter)
CharCollectionRemoves 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.Character>toArray in interface java.util.List<java.lang.Character>toArray in class java.util.AbstractCollection<java.lang.Character>@Deprecated 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>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 char[] toCharArray(char[] a)
AbstractCharCollectiontoCharArray in interface CharCollectiontoCharArray 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()
size in interface java.util.Collection<java.lang.Character>size in interface java.util.List<java.lang.Character>size in interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Character>public void size(int size)
CharListsize in interface CharListsize in class AbstractCharListsize - the requested amount of elements/room for elementspublic void clear()
clear in interface java.util.Collection<java.lang.Character>clear in interface java.util.List<java.lang.Character>clear in class java.util.AbstractCollection<java.lang.Character>public java.util.stream.IntStream primitiveStream()
public CharSplititerator spliterator()