public class ArrayCharList extends CharList.Base implements CharList, java.util.RandomAccess
CharList.Base| Constructor and Description |
|---|
ArrayCharList()
Create a new mutable
ArrayCharList. |
ArrayCharList(char[] xs) |
ArrayCharList(CharCollection xs) |
ArrayCharList(int capacity)
Deprecated.
Use
withCapacity(int) instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAllChars(char... xs) |
boolean |
addAllChars(CharCollection xs) |
boolean |
addAllCharsAt(int index,
char... xs) |
boolean |
addAllCharsAt(int index,
CharCollection xs) |
boolean |
addChar(char x) |
void |
addCharAt(int index,
char x) |
int |
binarySearch(char x) |
void |
clear() |
boolean |
containsAllChars(char... xs) |
boolean |
containsChar(char x) |
static ArrayCharList |
create()
Create a new empty mutable
ArrayCharList. |
static ArrayCharList |
create(char... xs)
Create a new mutable
ArrayCharList initialized with a copy of the given contents. |
void |
forEachChar(CharConsumer consumer)
Perform the given action for each
char in this iterable. |
char |
getChar(int index) |
int |
indexOfChar(char x) |
boolean |
isEmpty() |
CharIterator |
iterator() |
int |
lastIndexOfChar(char x) |
CharListIterator |
listIterator(int index) |
static ArrayCharList |
of(char... xs)
Deprecated.
Use
create(char...) instead. |
boolean |
removeAllChars(char... xs) |
boolean |
removeChar(char x) |
char |
removeCharAt(int index) |
boolean |
removeCharsIf(CharPredicate filter) |
void |
replaceAllChars(CharUnaryOperator operator) |
boolean |
retainAllChars(char... xs) |
char |
setChar(int index,
char x) |
int |
size() |
void |
sortChars() |
CharList |
subList(int from,
int to) |
char[] |
toCharArray()
Collect the
chars in this CharCollection into an char-array. |
protected void |
uncheckedAdd(int index,
CharIterable xs,
int xsSize) |
static ArrayCharList |
withCapacity(int capacity) |
equals, hashCodetoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, contains, containsAll, copy, get, indexOf, intSpliterator, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortChars, toArray, toArrayasReader, containsAllChars, containsAnyChars, containsAnyChars, forEach, from, from, intIterator, intStream, once, parallelIntStream, read, removeAllChars, retainAllChars, sequencepublic ArrayCharList()
ArrayCharList.@Deprecated public ArrayCharList(int capacity)
withCapacity(int) instead.ArrayCharList with the given initial capacity.public ArrayCharList(CharCollection xs)
public ArrayCharList(char[] xs)
@Deprecated public static ArrayCharList of(char... xs)
create(char...) instead.CharListCharList of the given elements. The returned CharList's
CharListIterator supports forward iteration only.of in interface CharIterableof in interface CharListArrayCharList initialized with a copy of the given contents.public static ArrayCharList create()
ArrayCharList. When possible, it's preferred to use
CharList.create() instead.create in interface CharListArrayCharList.CharList.create(),
withCapacity(int)public static ArrayCharList create(char... xs)
ArrayCharList initialized with a copy of the given contents. When possible, it's
preferred to use CharList.create(char...) instead.create in interface CharListArrayCharList initialized with a copy of the given contents.CharList.create(char...),
ArrayCharList(CharCollection)public static ArrayCharList withCapacity(int capacity)
ArrayCharList with the given initial capacity.public int size()
size in interface java.util.Collection<java.lang.Character>size in interface java.util.List<java.lang.Character>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Character>isEmpty in interface java.util.List<java.lang.Character>isEmpty in interface CharCollectionisEmpty in interface CharIterableisEmpty in interface CharListpublic void clear()
clear in interface java.util.Collection<java.lang.Character>clear in interface java.util.List<java.lang.Character>clear in interface CharCollectionclear in interface CharIterableclear in interface CharListpublic char[] toCharArray()
CharCollectionchars in this CharCollection into an char-array.toCharArray in interface CharCollectionpublic CharIterator iterator()
iterator in interface java.lang.Iterable<java.lang.Character>iterator in interface java.util.Collection<java.lang.Character>iterator in interface java.util.List<java.lang.Character>iterator in interface CharIterablepublic CharListIterator listIterator(int index)
listIterator in interface java.util.List<java.lang.Character>listIterator in interface CharListpublic int binarySearch(char x)
binarySearch in interface CharListpublic CharList subList(int from, int to)
public void replaceAllChars(CharUnaryOperator operator)
replaceAllChars in interface CharListpublic char removeCharAt(int index)
removeCharAt in interface CharListpublic int lastIndexOfChar(char x)
lastIndexOfChar in interface CharListpublic int indexOfChar(char x)
indexOfChar in interface CharListpublic boolean addChar(char x)
addChar in interface CharCollectionaddChar in interface CharListpublic boolean addAllChars(char... xs)
addAllChars in interface CharCollectionaddAllChars in interface CharListpublic boolean addAllChars(CharCollection xs)
addAllChars in interface CharCollectionaddAllChars in interface CharListpublic boolean addAllCharsAt(int index,
char... xs)
addAllCharsAt in interface CharListpublic boolean addAllCharsAt(int index,
CharCollection xs)
addAllCharsAt in interface CharListpublic boolean containsAllChars(char... xs)
containsAllChars in interface CharIterablepublic boolean removeChar(char x)
removeChar in interface CharIterablepublic boolean containsChar(char x)
containsChar in interface CharIterablepublic boolean removeAllChars(char... xs)
removeAllChars in interface CharIterablepublic boolean retainAllChars(char... xs)
retainAllChars in interface CharIterablepublic boolean removeCharsIf(CharPredicate filter)
removeCharsIf in interface CharIterablepublic void forEachChar(CharConsumer consumer)
CharIterablechar in this iterable.forEachChar in interface CharIterableprotected void uncheckedAdd(int index,
CharIterable xs,
int xsSize)