@NotThreadSafe public final class CharArrayList extends Object implements MutableCharList, Externalizable
FastList
, and is memory-optimized for char primitives.
This file was automatically generated from template file primitiveArrayList.stg.Constructor and Description |
---|
CharArrayList() |
CharArrayList(char... array) |
CharArrayList(int initialCapacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(char newItem) |
boolean |
addAll(char... source) |
boolean |
addAll(CharIterable source) |
boolean |
addAllAtIndex(int index,
char... source) |
boolean |
addAllAtIndex(int index,
CharIterable source) |
void |
addAtIndex(int index,
char element) |
boolean |
allSatisfy(CharPredicate predicate) |
boolean |
anySatisfy(CharPredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable . |
LazyCharIterable |
asLazy() |
LazyCharIterable |
asReversed() |
MutableCharList |
asSynchronized() |
MutableCharList |
asUnmodifiable() |
double |
average() |
CharIterator |
charIterator() |
void |
clear() |
<V> MutableList<V> |
collect(CharToObjectFunction<? extends V> function) |
boolean |
contains(char value) |
boolean |
containsAll(char... source) |
boolean |
containsAll(CharIterable source) |
int |
count(CharPredicate predicate) |
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
long |
dotProduct(CharList list) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(Object otherList)
Follows the same general contract as
List.equals(Object) . |
void |
forEach(CharProcedure procedure) |
void |
forEachWithIndex(CharIntProcedure procedure) |
char |
get(int index) |
char |
getFirst() |
char |
getLast() |
int |
hashCode()
Follows the same general contract as
List.hashCode() . |
int |
indexOf(char value) |
<T> T |
injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectCharIntToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(char value) |
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
char |
max() |
char |
maxIfEmpty(char defaultValue) |
double |
median() |
char |
min() |
char |
minIfEmpty(char defaultValue) |
static CharArrayList |
newList(CharIterable source) |
static CharArrayList |
newListWith(char... elements)
Creates a new list using the passed
elements argument as the backing store. |
static CharArrayList |
newWithNValues(int size,
char value) |
boolean |
noneSatisfy(CharPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
readExternal(ObjectInput in) |
CharArrayList |
reject(CharPredicate predicate) |
boolean |
remove(char value) |
boolean |
removeAll(char... source) |
boolean |
removeAll(CharIterable source) |
char |
removeAtIndex(int index) |
boolean |
retainAll(char... source) |
boolean |
retainAll(CharIterable source) |
CharArrayList |
reverseThis() |
CharArrayList |
select(CharPredicate predicate) |
char |
set(int index,
char element) |
int |
size()
Returns the number of items in this iterable.
|
CharArrayList |
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).
|
MutableCharList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
char[] |
toArray() |
MutableCharBag |
toBag() |
ImmutableCharList |
toImmutable()
Returns an immutable copy of this list.
|
MutableCharList |
toList() |
CharArrayList |
toReversed() |
MutableCharSet |
toSet() |
char[] |
toSortedArray() |
MutableCharList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
void |
trimToSize() |
CharArrayList |
with(char element) |
CharArrayList |
with(char element1,
char element2) |
CharArrayList |
with(char element1,
char element2,
char element3) |
CharArrayList |
with(char element1,
char element2,
char element3,
char... elements) |
CharArrayList |
withAll(CharIterable elements) |
CharArrayList |
without(char element) |
CharArrayList |
withoutAll(CharIterable elements) |
void |
writeExternal(ObjectOutput out) |
public CharArrayList()
public CharArrayList(int initialCapacity)
public CharArrayList(char... array)
public static CharArrayList newListWith(char... elements)
elements
argument as the backing store.
!!! WARNING: This method uses the passed in array, so can be very unsafe if the original
array is held onto anywhere else. !!!public static CharArrayList newList(CharIterable source)
public static CharArrayList newWithNValues(int size, char value)
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public boolean isEmpty()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
public void clear()
clear
in interface MutableCharCollection
public boolean contains(char value)
contains
in interface CharIterable
public boolean containsAll(char... source)
containsAll
in interface CharIterable
public boolean containsAll(CharIterable source)
containsAll
in interface CharIterable
public char getFirst()
getFirst
in interface ReversibleCharIterable
public char getLast()
getLast
in interface ReversibleCharIterable
public int indexOf(char value)
indexOf
in interface ReversibleCharIterable
public int lastIndexOf(char value)
lastIndexOf
in interface CharList
public void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(char newItem)
add
in interface MutableCharCollection
public boolean addAll(char... source)
addAll
in interface MutableCharCollection
public boolean addAll(CharIterable source)
addAll
in interface MutableCharCollection
public void addAtIndex(int index, char element)
addAtIndex
in interface MutableCharList
public boolean addAllAtIndex(int index, char... source)
addAllAtIndex
in interface MutableCharList
public boolean addAllAtIndex(int index, CharIterable source)
addAllAtIndex
in interface MutableCharList
public boolean remove(char value)
remove
in interface MutableCharCollection
public boolean removeAll(CharIterable source)
removeAll
in interface MutableCharCollection
public boolean removeAll(char... source)
removeAll
in interface MutableCharCollection
public boolean retainAll(CharIterable source)
retainAll
in interface MutableCharCollection
Collection.retainAll(Collection)
public boolean retainAll(char... source)
retainAll
in interface MutableCharCollection
Collection.retainAll(Collection)
public char removeAtIndex(int index)
removeAtIndex
in interface MutableCharList
public char set(int index, char element)
set
in interface MutableCharList
public CharArrayList with(char element)
with
in interface MutableCharCollection
with
in interface MutableCharList
public CharArrayList without(char element)
without
in interface MutableCharCollection
without
in interface MutableCharList
public CharArrayList withAll(CharIterable elements)
withAll
in interface MutableCharCollection
withAll
in interface MutableCharList
public CharArrayList withoutAll(CharIterable elements)
withoutAll
in interface MutableCharCollection
withoutAll
in interface MutableCharList
public CharArrayList with(char element1, char element2)
public CharArrayList with(char element1, char element2, char element3)
public CharArrayList with(char element1, char element2, char element3, char... elements)
public CharIterator charIterator()
charIterator
in interface CharIterable
public void forEach(CharProcedure procedure)
forEach
in interface CharIterable
public void forEachWithIndex(CharIntProcedure procedure)
forEachWithIndex
in interface ReversibleCharIterable
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto
in interface CharIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface ReversibleCharIterable
public int count(CharPredicate predicate)
count
in interface CharIterable
public boolean anySatisfy(CharPredicate predicate)
anySatisfy
in interface CharIterable
public boolean allSatisfy(CharPredicate predicate)
allSatisfy
in interface CharIterable
public boolean noneSatisfy(CharPredicate predicate)
noneSatisfy
in interface CharIterable
public CharArrayList select(CharPredicate predicate)
select
in interface CharIterable
select
in interface MutableCharCollection
select
in interface CharList
select
in interface MutableCharList
select
in interface ReversibleCharIterable
public CharArrayList reject(CharPredicate predicate)
reject
in interface CharIterable
reject
in interface MutableCharCollection
reject
in interface CharList
reject
in interface MutableCharList
reject
in interface ReversibleCharIterable
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone
in interface CharIterable
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
collect
in interface CharIterable
collect
in interface MutableCharCollection
collect
in interface CharList
collect
in interface MutableCharList
collect
in interface ReversibleCharIterable
public char max()
max
in interface CharIterable
public char min()
min
in interface CharIterable
public char minIfEmpty(char defaultValue)
minIfEmpty
in interface CharIterable
public char maxIfEmpty(char defaultValue)
maxIfEmpty
in interface CharIterable
public long sum()
sum
in interface CharIterable
public long dotProduct(CharList list)
dotProduct
in interface CharList
public double average()
average
in interface CharIterable
public double median()
median
in interface CharIterable
public char[] toArray()
toArray
in interface CharIterable
public char[] toSortedArray()
toSortedArray
in interface CharIterable
public boolean equals(Object otherList)
CharList
List.equals(Object)
.public int hashCode()
CharList
List.hashCode()
.public String toString()
PrimitiveIterable
toString
in interface PrimitiveIterable
toString
in class Object
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", " (comma and space).makeString
in interface PrimitiveIterable
public String makeString(String separator)
PrimitiveIterable
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString
in interface PrimitiveIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public MutableCharList toList()
toList
in interface CharIterable
public MutableCharList toSortedList()
toSortedList
in interface CharIterable
public MutableCharSet toSet()
toSet
in interface CharIterable
public MutableCharBag toBag()
toBag
in interface CharIterable
public LazyCharIterable asLazy()
asLazy
in interface CharIterable
public MutableCharList asUnmodifiable()
asUnmodifiable
in interface MutableCharCollection
asUnmodifiable
in interface MutableCharList
public MutableCharList asSynchronized()
asSynchronized
in interface MutableCharCollection
asSynchronized
in interface MutableCharList
public ImmutableCharList toImmutable()
MutableCharList
toImmutable
in interface MutableCharCollection
toImmutable
in interface CharList
toImmutable
in interface MutableCharList
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public LazyCharIterable asReversed()
asReversed
in interface ReversibleCharIterable
public CharArrayList reverseThis()
reverseThis
in interface MutableCharList
public CharArrayList sortThis()
MutableCharList
sortThis
in interface MutableCharList
public CharArrayList toReversed()
toReversed
in interface CharList
toReversed
in interface MutableCharList
toReversed
in interface ReversibleCharIterable
public MutableCharList subList(int fromIndex, int toIndex)
subList
in interface CharList
subList
in interface MutableCharList
List#subList(int fromIndex, int toIndex)}
Copyright © 2004–2016. All rights reserved.