java.io.Externalizable
, java.io.Serializable
, CharIterable
, MutableCharCollection
, CharList
, MutableCharList
, OrderedCharIterable
, ReversibleCharIterable
, PrimitiveIterable
public class CharArrayList extends AbstractCharIterable implements MutableCharList, java.io.Externalizable
FastList
, and is memory-optimized for char primitives.
This file was automatically generated from template file primitiveArrayList.stg.Constructor | Description |
---|---|
CharArrayList() |
|
CharArrayList(char... array) |
|
CharArrayList(int initialCapacity) |
Modifier and Type | Method | 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) |
Returns true if all of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(CharPredicate predicate) |
Returns true if any of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
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 . |
LazyCharIterable |
asReversed() |
|
MutableCharList |
asSynchronized() |
|
MutableCharList |
asUnmodifiable() |
|
int |
binarySearch(char value) |
|
MutableCharIterator |
charIterator() |
Returns a primitive iterator that can be used to iterate over the CharIterable in an
imperative style.
|
void |
clear() |
|
<V> MutableList<V> |
collect(CharToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
<V,R extends java.util.Collection<V>> |
collect(CharToObjectFunction<? extends V> function,
R target) |
Same as
CharIterable.collect(CharToObjectFunction) , only the results are added to the target Collection. |
boolean |
contains(char value) |
Returns true if the value is contained in the CharIterable, and false if it is not.
|
int |
count(CharPredicate predicate) |
Returns a count of the number of elements in the CharIterable that return true for the
specified predicate.
|
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
|
MutableCharList |
distinct() |
|
long |
dotProduct(CharList list) |
|
void |
each(CharProcedure procedure) |
A synonym for forEach.
|
void |
ensureCapacity(int minCapacity) |
|
boolean |
equals(java.lang.Object otherList) |
Follows the same general contract as
List.equals(Object) . |
void |
forEach(CharProcedure procedure) |
Applies the CharProcedure to each element in the CharIterable.
|
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) |
|
int |
lastIndexOf(char value) |
|
char |
max() |
|
char |
min() |
|
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) |
Returns true if none of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(java.io.ObjectInput in) |
|
CharArrayList |
reject(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return false for the specified predicate.
|
<R extends MutableCharCollection> |
reject(CharPredicate predicate,
R target) |
Same as
CharIterable.reject(CharPredicate) , only the results are added to the target MutableCharCollection. |
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) |
Returns a new CharIterable with all of the elements in the CharIterable that
return true for the specified predicate.
|
<R extends MutableCharCollection> |
select(CharPredicate predicate,
R target) |
Same as
CharIterable.select(CharPredicate) , only the results are added to the target MutableCharCollection. |
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() |
Converts the CharIterable to a primitive char array.
|
ImmutableCharList |
toImmutable() |
Returns an immutable copy of this list.
|
CharArrayList |
toReversed() |
|
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(java.io.ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
tap
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
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 void clear()
clear
in interface MutableCharCollection
public boolean contains(char value)
CharIterable
contains
in interface CharIterable
public char getFirst()
getFirst
in interface OrderedCharIterable
public char getLast()
getLast
in interface ReversibleCharIterable
public int indexOf(char value)
indexOf
in interface OrderedCharIterable
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 MutableCharIterator charIterator()
CharIterable
charIterator
in interface CharIterable
charIterator
in interface MutableCharCollection
public void forEach(CharProcedure procedure)
CharIterable
forEach
in interface CharIterable
public void each(CharProcedure procedure)
CharIterable
each
in interface CharIterable
public void forEachWithIndex(CharIntProcedure procedure)
forEachWithIndex
in interface OrderedCharIterable
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 OrderedCharIterable
injectIntoWithIndex
in interface ReversibleCharIterable
public int count(CharPredicate predicate)
CharIterable
count
in interface CharIterable
public boolean anySatisfy(CharPredicate predicate)
CharIterable
anySatisfy
in interface CharIterable
public boolean allSatisfy(CharPredicate predicate)
CharIterable
allSatisfy
in interface CharIterable
public boolean noneSatisfy(CharPredicate predicate)
CharIterable
noneSatisfy
in interface CharIterable
public CharArrayList select(CharPredicate predicate)
CharIterable
select
in interface CharIterable
select
in interface CharList
select
in interface MutableCharCollection
select
in interface MutableCharList
select
in interface OrderedCharIterable
select
in interface ReversibleCharIterable
public <R extends MutableCharCollection> R select(CharPredicate predicate, R target)
CharIterable
CharIterable.select(CharPredicate)
, only the results are added to the target MutableCharCollection.select
in interface CharIterable
public CharArrayList reject(CharPredicate predicate)
CharIterable
reject
in interface CharIterable
reject
in interface CharList
reject
in interface MutableCharCollection
reject
in interface MutableCharList
reject
in interface OrderedCharIterable
reject
in interface ReversibleCharIterable
public <R extends MutableCharCollection> R reject(CharPredicate predicate, R target)
CharIterable
CharIterable.reject(CharPredicate)
, only the results are added to the target MutableCharCollection.reject
in interface CharIterable
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone
in interface CharIterable
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
CharIterable
collect
in interface CharIterable
collect
in interface CharList
collect
in interface MutableCharCollection
collect
in interface MutableCharList
collect
in interface OrderedCharIterable
collect
in interface ReversibleCharIterable
public <V,R extends java.util.Collection<V>> R collect(CharToObjectFunction<? extends V> function, R target)
CharIterable
CharIterable.collect(CharToObjectFunction)
, only the results are added to the target Collection.collect
in interface CharIterable
public char max()
max
in interface CharIterable
public char min()
min
in interface CharIterable
public long sum()
sum
in interface CharIterable
public long dotProduct(CharList list)
dotProduct
in interface CharList
public char[] toArray()
CharIterable
toArray
in interface CharIterable
public boolean equals(java.lang.Object otherList)
CharList
List.equals(Object)
.public int hashCode()
CharList
List.hashCode()
.public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
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 CharList
toImmutable
in interface MutableCharCollection
toImmutable
in interface MutableCharList
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
java.io.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 int binarySearch(char value)
binarySearch
in interface CharList
public MutableCharList distinct()
distinct
in interface CharList
distinct
in interface MutableCharList
distinct
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–2017. All rights reserved.