@NotThreadSafe
public final class CharArrayList
extends java.lang.Object
implements com.gs.collections.api.list.primitive.MutableCharList, java.io.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(com.gs.collections.api.CharIterable source) |
boolean |
addAllAtIndex(int index,
char... source) |
boolean |
addAllAtIndex(int index,
com.gs.collections.api.CharIterable source) |
void |
addAtIndex(int index,
char element) |
boolean |
allSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
boolean |
anySatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
void |
appendString(java.lang.Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(java.lang.Appendable appendable,
java.lang.String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
Prints a string representation of this collection onto the given
Appendable. |
com.gs.collections.api.LazyCharIterable |
asLazy() |
com.gs.collections.api.LazyCharIterable |
asReversed() |
com.gs.collections.api.list.primitive.MutableCharList |
asSynchronized() |
com.gs.collections.api.list.primitive.MutableCharList |
asUnmodifiable() |
double |
average() |
com.gs.collections.api.iterator.CharIterator |
charIterator() |
void |
clear() |
<V> com.gs.collections.api.list.MutableList<V> |
collect(com.gs.collections.api.block.function.primitive.CharToObjectFunction<? extends V> function) |
boolean |
contains(char value) |
boolean |
containsAll(char... source) |
boolean |
containsAll(com.gs.collections.api.CharIterable source) |
int |
count(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
char |
detectIfNone(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char ifNone) |
long |
dotProduct(com.gs.collections.api.list.primitive.CharList list) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(java.lang.Object otherList)
Follows the same general contract as
List.equals(Object). |
void |
forEach(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure) |
void |
forEachWithIndex(com.gs.collections.api.block.procedure.primitive.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,
com.gs.collections.api.block.function.primitive.ObjectCharToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectCharIntToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(char value) |
java.lang.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). |
java.lang.String |
makeString(java.lang.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). |
java.lang.String |
makeString(java.lang.String start,
java.lang.String separator,
java.lang.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(com.gs.collections.api.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(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
readExternal(java.io.ObjectInput in) |
CharArrayList |
reject(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
boolean |
remove(char value) |
boolean |
removeAll(char... source) |
boolean |
removeAll(com.gs.collections.api.CharIterable source) |
char |
removeAtIndex(int index) |
boolean |
retainAll(char... source) |
boolean |
retainAll(com.gs.collections.api.CharIterable source) |
CharArrayList |
reverseThis() |
CharArrayList |
select(com.gs.collections.api.block.predicate.primitive.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).
|
com.gs.collections.api.list.primitive.MutableCharList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
char[] |
toArray() |
com.gs.collections.api.bag.primitive.MutableCharBag |
toBag() |
com.gs.collections.api.list.primitive.ImmutableCharList |
toImmutable()
Returns an immutable copy of this list.
|
com.gs.collections.api.list.primitive.MutableCharList |
toList() |
CharArrayList |
toReversed() |
com.gs.collections.api.set.primitive.MutableCharSet |
toSet() |
char[] |
toSortedArray() |
com.gs.collections.api.list.primitive.MutableCharList |
toSortedList() |
java.lang.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(com.gs.collections.api.CharIterable elements) |
CharArrayList |
without(char element) |
CharArrayList |
withoutAll(com.gs.collections.api.CharIterable elements) |
void |
writeExternal(java.io.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(com.gs.collections.api.CharIterable source)
public static CharArrayList newWithNValues(int size, char value)
public int size()
com.gs.collections.api.PrimitiveIterablesize in interface com.gs.collections.api.PrimitiveIterablepublic boolean isEmpty()
com.gs.collections.api.PrimitiveIterableisEmpty in interface com.gs.collections.api.PrimitiveIterablepublic boolean notEmpty()
com.gs.collections.api.PrimitiveIterablenotEmpty in interface com.gs.collections.api.PrimitiveIterablepublic void clear()
clear in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean contains(char value)
contains in interface com.gs.collections.api.CharIterablepublic boolean containsAll(char... source)
containsAll in interface com.gs.collections.api.CharIterablepublic boolean containsAll(com.gs.collections.api.CharIterable source)
containsAll in interface com.gs.collections.api.CharIterablepublic char get(int index)
get in interface com.gs.collections.api.list.primitive.CharListpublic char getFirst()
getFirst in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic char getLast()
getLast in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic int indexOf(char value)
indexOf in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic int lastIndexOf(char value)
lastIndexOf in interface com.gs.collections.api.list.primitive.CharListpublic void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(char newItem)
add in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean addAll(char... source)
addAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean addAll(com.gs.collections.api.CharIterable source)
addAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic void addAtIndex(int index,
char element)
addAtIndex in interface com.gs.collections.api.list.primitive.MutableCharListpublic boolean addAllAtIndex(int index,
char... source)
addAllAtIndex in interface com.gs.collections.api.list.primitive.MutableCharListpublic boolean addAllAtIndex(int index,
com.gs.collections.api.CharIterable source)
addAllAtIndex in interface com.gs.collections.api.list.primitive.MutableCharListpublic boolean remove(char value)
remove in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean removeAll(com.gs.collections.api.CharIterable source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean removeAll(char... source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean retainAll(com.gs.collections.api.CharIterable source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionCollection.retainAll(Collection)public boolean retainAll(char... source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionCollection.retainAll(Collection)public char removeAtIndex(int index)
removeAtIndex in interface com.gs.collections.api.list.primitive.MutableCharListpublic char set(int index,
char element)
set in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList with(char element)
with in interface com.gs.collections.api.collection.primitive.MutableCharCollectionwith in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList without(char element)
without in interface com.gs.collections.api.collection.primitive.MutableCharCollectionwithout in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList withAll(com.gs.collections.api.CharIterable elements)
withAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionwithAll in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList withoutAll(com.gs.collections.api.CharIterable elements)
withoutAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionwithoutAll in interface com.gs.collections.api.list.primitive.MutableCharListpublic 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 com.gs.collections.api.iterator.CharIterator charIterator()
charIterator in interface com.gs.collections.api.CharIterablepublic void forEach(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
forEach in interface com.gs.collections.api.CharIterablepublic void forEachWithIndex(com.gs.collections.api.block.procedure.primitive.CharIntProcedure procedure)
forEachWithIndex in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic <T> T injectInto(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto in interface com.gs.collections.api.CharIterablepublic <T> T injectIntoWithIndex(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectCharIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic int count(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
count in interface com.gs.collections.api.CharIterablepublic boolean anySatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
anySatisfy in interface com.gs.collections.api.CharIterablepublic boolean allSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
allSatisfy in interface com.gs.collections.api.CharIterablepublic boolean noneSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
noneSatisfy in interface com.gs.collections.api.CharIterablepublic CharArrayList select(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
select in interface com.gs.collections.api.CharIterableselect in interface com.gs.collections.api.collection.primitive.MutableCharCollectionselect in interface com.gs.collections.api.list.primitive.CharListselect in interface com.gs.collections.api.list.primitive.MutableCharListselect in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic CharArrayList reject(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
reject in interface com.gs.collections.api.CharIterablereject in interface com.gs.collections.api.collection.primitive.MutableCharCollectionreject in interface com.gs.collections.api.list.primitive.CharListreject in interface com.gs.collections.api.list.primitive.MutableCharListreject in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic char detectIfNone(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char ifNone)
detectIfNone in interface com.gs.collections.api.CharIterablepublic <V> com.gs.collections.api.list.MutableList<V> collect(com.gs.collections.api.block.function.primitive.CharToObjectFunction<? extends V> function)
collect in interface com.gs.collections.api.CharIterablecollect in interface com.gs.collections.api.collection.primitive.MutableCharCollectioncollect in interface com.gs.collections.api.list.primitive.CharListcollect in interface com.gs.collections.api.list.primitive.MutableCharListcollect in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic char max()
max in interface com.gs.collections.api.CharIterablepublic char min()
min in interface com.gs.collections.api.CharIterablepublic char minIfEmpty(char defaultValue)
minIfEmpty in interface com.gs.collections.api.CharIterablepublic char maxIfEmpty(char defaultValue)
maxIfEmpty in interface com.gs.collections.api.CharIterablepublic long sum()
sum in interface com.gs.collections.api.CharIterablepublic long dotProduct(com.gs.collections.api.list.primitive.CharList list)
dotProduct in interface com.gs.collections.api.list.primitive.CharListpublic double average()
average in interface com.gs.collections.api.CharIterablepublic double median()
median in interface com.gs.collections.api.CharIterablepublic char[] toArray()
toArray in interface com.gs.collections.api.CharIterablepublic char[] toSortedArray()
toSortedArray in interface com.gs.collections.api.CharIterablepublic boolean equals(java.lang.Object otherList)
com.gs.collections.api.list.primitive.CharListList.equals(Object).equals in interface com.gs.collections.api.list.primitive.CharListequals in class java.lang.Objectpublic int hashCode()
com.gs.collections.api.list.primitive.CharListList.hashCode().hashCode in interface com.gs.collections.api.list.primitive.CharListhashCode in class java.lang.Objectpublic java.lang.String toString()
com.gs.collections.api.PrimitiveIterabletoString in interface com.gs.collections.api.PrimitiveIterabletoString in class java.lang.Objectpublic java.lang.String makeString()
com.gs.collections.api.PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface com.gs.collections.api.PrimitiveIterablepublic java.lang.String makeString(java.lang.String separator)
com.gs.collections.api.PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface com.gs.collections.api.PrimitiveIterablepublic java.lang.String makeString(java.lang.String start,
java.lang.String separator,
java.lang.String end)
com.gs.collections.api.PrimitiveIterablemakeString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable,
java.lang.String separator)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface com.gs.collections.api.PrimitiveIterablepublic void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface com.gs.collections.api.PrimitiveIterablepublic com.gs.collections.api.list.primitive.MutableCharList toList()
toList in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.list.primitive.MutableCharList toSortedList()
toSortedList in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.set.primitive.MutableCharSet toSet()
toSet in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.bag.primitive.MutableCharBag toBag()
toBag in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.LazyCharIterable asLazy()
asLazy in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.list.primitive.MutableCharList asUnmodifiable()
asUnmodifiable in interface com.gs.collections.api.collection.primitive.MutableCharCollectionasUnmodifiable in interface com.gs.collections.api.list.primitive.MutableCharListpublic com.gs.collections.api.list.primitive.MutableCharList asSynchronized()
asSynchronized in interface com.gs.collections.api.collection.primitive.MutableCharCollectionasSynchronized in interface com.gs.collections.api.list.primitive.MutableCharListpublic com.gs.collections.api.list.primitive.ImmutableCharList toImmutable()
com.gs.collections.api.list.primitive.MutableCharListtoImmutable in interface com.gs.collections.api.collection.primitive.MutableCharCollectiontoImmutable in interface com.gs.collections.api.list.primitive.CharListtoImmutable in interface com.gs.collections.api.list.primitive.MutableCharListpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionpublic com.gs.collections.api.LazyCharIterable asReversed()
asReversed in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic CharArrayList reverseThis()
reverseThis in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList sortThis()
com.gs.collections.api.list.primitive.MutableCharListsortThis in interface com.gs.collections.api.list.primitive.MutableCharListpublic CharArrayList toReversed()
toReversed in interface com.gs.collections.api.list.primitive.CharListtoReversed in interface com.gs.collections.api.list.primitive.MutableCharListtoReversed in interface com.gs.collections.api.ordered.primitive.ReversibleCharIterablepublic com.gs.collections.api.list.primitive.MutableCharList subList(int fromIndex,
int toIndex)
subList in interface com.gs.collections.api.list.primitive.CharListsubList in interface com.gs.collections.api.list.primitive.MutableCharListList#subList(int fromIndex, int toIndex)}