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, hashCode
toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, add, addAll, addAll, contains, containsAll, copy, get, indexOf, intSpliterator, lastIndexOf, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, sort, sortChars, toArray, toArray
asReader, containsAllChars, containsAnyChars, containsAnyChars, forEach, from, from, intIterator, intStream, once, parallelIntStream, read, removeAllChars, retainAllChars, sequence
public 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.CharList
CharList
of the given elements. The returned CharList
's
CharListIterator
supports forward iteration only.of
in interface CharIterable
of
in interface CharList
ArrayCharList
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 CharList
ArrayCharList
.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 CharList
ArrayCharList
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 CharCollection
isEmpty
in interface CharIterable
isEmpty
in interface CharList
public void clear()
clear
in interface java.util.Collection<java.lang.Character>
clear
in interface java.util.List<java.lang.Character>
clear
in interface CharCollection
clear
in interface CharIterable
clear
in interface CharList
public char[] toCharArray()
CharCollection
chars
in this CharCollection
into an char
-array.toCharArray
in interface CharCollection
public 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 CharIterable
public CharListIterator listIterator(int index)
listIterator
in interface java.util.List<java.lang.Character>
listIterator
in interface CharList
public int binarySearch(char x)
binarySearch
in interface CharList
public CharList subList(int from, int to)
public void replaceAllChars(CharUnaryOperator operator)
replaceAllChars
in interface CharList
public char removeCharAt(int index)
removeCharAt
in interface CharList
public int lastIndexOfChar(char x)
lastIndexOfChar
in interface CharList
public int indexOfChar(char x)
indexOfChar
in interface CharList
public boolean addChar(char x)
addChar
in interface CharCollection
addChar
in interface CharList
public boolean addAllChars(char... xs)
addAllChars
in interface CharCollection
addAllChars
in interface CharList
public boolean addAllChars(CharCollection xs)
addAllChars
in interface CharCollection
addAllChars
in interface CharList
public boolean addAllCharsAt(int index, char... xs)
addAllCharsAt
in interface CharList
public boolean addAllCharsAt(int index, CharCollection xs)
addAllCharsAt
in interface CharList
public boolean containsAllChars(char... xs)
containsAllChars
in interface CharIterable
public boolean removeChar(char x)
removeChar
in interface CharIterable
public boolean containsChar(char x)
containsChar
in interface CharIterable
public boolean removeAllChars(char... xs)
removeAllChars
in interface CharIterable
public boolean retainAllChars(char... xs)
retainAllChars
in interface CharIterable
public boolean removeCharsIf(CharPredicate filter)
removeCharsIf
in interface CharIterable
public void forEachChar(CharConsumer consumer)
CharIterable
char
in this iterable.forEachChar
in interface CharIterable
protected void uncheckedAdd(int index, CharIterable xs, int xsSize)