Class CharArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractCharIterable
-
- org.eclipse.collections.impl.list.mutable.primitive.CharArrayList
-
- All Implemented Interfaces:
Externalizable
,Serializable
,CharIterable
,MutableCharCollection
,CharList
,MutableCharList
,OrderedCharIterable
,ReversibleCharIterable
,PrimitiveIterable
public class CharArrayList extends AbstractCharIterable implements MutableCharList, Externalizable
CharArrayList is similar to FastList, and is memory-optimized for char primitives. This file was automatically generated from template file primitiveArrayList.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CharArrayList()
CharArrayList(char... array)
CharArrayList(int initialCapacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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)
boolean
anySatisfy(CharPredicate predicate)
void
appendString(Appendable appendable, String start, String separator, String end)
LazyCharIterable
asReversed()
MutableCharList
asSynchronized()
MutableCharList
asUnmodifiable()
int
binarySearch(char value)
MutableList<Character>
boxed()
MutableCharIterator
charIterator()
RichIterable<CharIterable>
chunk(int size)
void
clear()
<V> MutableList<V>
collect(CharToObjectFunction<? extends V> function)
<V,R extends Collection<V>>
Rcollect(CharToObjectFunction<? extends V> function, R target)
boolean
contains(char value)
int
count(CharPredicate predicate)
char
detectIfNone(CharPredicate predicate, char ifNone)
MutableCharList
distinct()
long
dotProduct(CharList list)
void
each(CharProcedure procedure)
void
ensureCapacity(int minCapacity)
boolean
equals(Object otherList)
void
forEachWithIndex(CharIntProcedure procedure)
char
get(int index)
char
getFirst()
char
getLast()
int
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()
CharArrayList
newEmpty()
Creates a new empty CharArrayList.static CharArrayList
newList(CharIterable source)
static CharArrayList
newListWith(char... elements)
Creates a new list using the passedelements
argument as the backing store.static CharArrayList
newWithNValues(int size, char value)
void
readExternal(ObjectInput in)
CharArrayList
reject(CharPredicate predicate)
<R extends MutableCharCollection>
Rreject(CharPredicate predicate, R target)
boolean
remove(char value)
boolean
removeAll(char... source)
boolean
removeAll(CharIterable source)
char
removeAtIndex(int index)
boolean
removeIf(CharPredicate predicate)
boolean
retainAll(char... source)
boolean
retainAll(CharIterable source)
CharArrayList
reverseThis()
CharArrayList
select(CharPredicate predicate)
<R extends MutableCharCollection>
Rselect(CharPredicate predicate, R target)
char
set(int index, char element)
int
size()
CharArrayList
sortThis()
CharArrayList
sortThis(CharComparator comparator)
MutableCharList
subList(int fromIndex, int toIndex)
long
sum()
void
swap(int index1, int index2)
char[]
toArray()
char[]
toArray(char[] target)
ImmutableCharList
toImmutable()
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)
static CharArrayList
wrapCopy(char... array)
Creates a new list by first copying the array passed in.void
writeExternal(ObjectOutput out)
<T> MutableList<CharObjectPair<T>>
zip(Iterable<T> iterable)
MutableList<CharCharPair>
zipChar(CharIterable iterable)
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractCharIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.CharIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.CharList
forEachInBoth
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableCharList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedCharIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Method Detail
-
newListWith
public static CharArrayList newListWith(char... elements)
Creates a new list using the passedelements
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. !!!
-
newList
public static CharArrayList newList(CharIterable source)
-
newWithNValues
public static CharArrayList newWithNValues(int size, char value)
-
wrapCopy
public static CharArrayList wrapCopy(char... array)
Creates a new list by first copying the array passed in.
-
size
public int size()
- Specified by:
size
in interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableCharCollection
-
contains
public boolean contains(char value)
- Specified by:
contains
in interfaceCharIterable
-
getFirst
public char getFirst()
- Specified by:
getFirst
in interfaceOrderedCharIterable
-
getLast
public char getLast()
- Specified by:
getLast
in interfaceReversibleCharIterable
-
indexOf
public int indexOf(char value)
- Specified by:
indexOf
in interfaceOrderedCharIterable
-
lastIndexOf
public int lastIndexOf(char value)
- Specified by:
lastIndexOf
in interfaceCharList
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(char newItem)
- Specified by:
add
in interfaceMutableCharCollection
-
addAll
public boolean addAll(char... source)
- Specified by:
addAll
in interfaceMutableCharCollection
-
addAll
public boolean addAll(CharIterable source)
- Specified by:
addAll
in interfaceMutableCharCollection
-
addAtIndex
public void addAtIndex(int index, char element)
- Specified by:
addAtIndex
in interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, char... source)
- Specified by:
addAllAtIndex
in interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, CharIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableCharList
-
remove
public boolean remove(char value)
- Specified by:
remove
in interfaceMutableCharCollection
-
removeIf
public boolean removeIf(CharPredicate predicate)
- Specified by:
removeIf
in interfaceMutableCharCollection
-
removeAll
public boolean removeAll(CharIterable source)
- Specified by:
removeAll
in interfaceMutableCharCollection
-
removeAll
public boolean removeAll(char... source)
- Specified by:
removeAll
in interfaceMutableCharCollection
-
retainAll
public boolean retainAll(CharIterable source)
- Specified by:
retainAll
in interfaceMutableCharCollection
-
retainAll
public boolean retainAll(char... source)
- Specified by:
retainAll
in interfaceMutableCharCollection
-
removeAtIndex
public char removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableCharList
-
set
public char set(int index, char element)
- Specified by:
set
in interfaceMutableCharList
-
swap
public void swap(int index1, int index2)
- Specified by:
swap
in interfaceMutableCharList
-
with
public CharArrayList with(char element)
- Specified by:
with
in interfaceMutableCharCollection
- Specified by:
with
in interfaceMutableCharList
-
without
public CharArrayList without(char element)
- Specified by:
without
in interfaceMutableCharCollection
- Specified by:
without
in interfaceMutableCharList
-
withAll
public CharArrayList withAll(CharIterable elements)
- Specified by:
withAll
in interfaceMutableCharCollection
- Specified by:
withAll
in interfaceMutableCharList
-
withoutAll
public CharArrayList withoutAll(CharIterable elements)
- Specified by:
withoutAll
in interfaceMutableCharCollection
- Specified by:
withoutAll
in interfaceMutableCharList
-
with
public CharArrayList with(char element1, char element2)
-
with
public CharArrayList with(char element1, char element2, char element3)
-
with
public CharArrayList with(char element1, char element2, char element3, char... elements)
-
charIterator
public MutableCharIterator charIterator()
- Specified by:
charIterator
in interfaceCharIterable
- Specified by:
charIterator
in interfaceMutableCharCollection
-
each
public void each(CharProcedure procedure)
- Specified by:
each
in interfaceCharIterable
- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(CharIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedCharIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)
- Specified by:
injectInto
in interfaceCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedCharIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleCharIterable
-
chunk
public RichIterable<CharIterable> chunk(int size)
- Specified by:
chunk
in interfaceCharIterable
-
count
public int count(CharPredicate predicate)
- Specified by:
count
in interfaceCharIterable
-
anySatisfy
public boolean anySatisfy(CharPredicate predicate)
- Specified by:
anySatisfy
in interfaceCharIterable
-
allSatisfy
public boolean allSatisfy(CharPredicate predicate)
- Specified by:
allSatisfy
in interfaceCharIterable
-
select
public CharArrayList select(CharPredicate predicate)
- Specified by:
select
in interfaceCharIterable
- Specified by:
select
in interfaceCharList
- Specified by:
select
in interfaceMutableCharCollection
- Specified by:
select
in interfaceMutableCharList
- Specified by:
select
in interfaceOrderedCharIterable
- Specified by:
select
in interfaceReversibleCharIterable
-
select
public <R extends MutableCharCollection> R select(CharPredicate predicate, R target)
- Specified by:
select
in interfaceCharIterable
- Since:
- 8.1.
-
reject
public CharArrayList reject(CharPredicate predicate)
- Specified by:
reject
in interfaceCharIterable
- Specified by:
reject
in interfaceCharList
- Specified by:
reject
in interfaceMutableCharCollection
- Specified by:
reject
in interfaceMutableCharList
- Specified by:
reject
in interfaceOrderedCharIterable
- Specified by:
reject
in interfaceReversibleCharIterable
-
reject
public <R extends MutableCharCollection> R reject(CharPredicate predicate, R target)
- Specified by:
reject
in interfaceCharIterable
- Since:
- 8.1.
-
detectIfNone
public char detectIfNone(CharPredicate predicate, char ifNone)
- Specified by:
detectIfNone
in interfaceCharIterable
-
collect
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceCharIterable
- Specified by:
collect
in interfaceCharList
- Specified by:
collect
in interfaceMutableCharCollection
- Specified by:
collect
in interfaceMutableCharList
- Specified by:
collect
in interfaceOrderedCharIterable
- Specified by:
collect
in interfaceReversibleCharIterable
-
collect
public <V,R extends Collection<V>> R collect(CharToObjectFunction<? extends V> function, R target)
- Specified by:
collect
in interfaceCharIterable
- Since:
- 8.1.
-
max
public char max()
- Specified by:
max
in interfaceCharIterable
-
min
public char min()
- Specified by:
min
in interfaceCharIterable
-
sum
public long sum()
- Specified by:
sum
in interfaceCharIterable
-
dotProduct
public long dotProduct(CharList list)
- Specified by:
dotProduct
in interfaceCharList
-
toArray
public char[] toArray()
- Specified by:
toArray
in interfaceCharIterable
-
toArray
public char[] toArray(char[] target)
- Specified by:
toArray
in interfaceCharIterable
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfacePrimitiveIterable
-
asUnmodifiable
public MutableCharList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableCharCollection
- Specified by:
asUnmodifiable
in interfaceMutableCharList
-
asSynchronized
public MutableCharList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableCharCollection
- Specified by:
asSynchronized
in interfaceMutableCharList
-
toImmutable
public ImmutableCharList toImmutable()
- Specified by:
toImmutable
in interfaceCharList
- Specified by:
toImmutable
in interfaceMutableCharCollection
- Specified by:
toImmutable
in interfaceMutableCharList
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
asReversed
public LazyCharIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleCharIterable
-
reverseThis
public CharArrayList reverseThis()
- Specified by:
reverseThis
in interfaceMutableCharList
-
sortThis
public CharArrayList sortThis()
- Specified by:
sortThis
in interfaceMutableCharList
-
sortThis
public CharArrayList sortThis(CharComparator comparator)
- Specified by:
sortThis
in interfaceMutableCharList
-
toReversed
public CharArrayList toReversed()
- Specified by:
toReversed
in interfaceCharList
- Specified by:
toReversed
in interfaceMutableCharList
- Specified by:
toReversed
in interfaceReversibleCharIterable
-
binarySearch
public int binarySearch(char value)
- Specified by:
binarySearch
in interfaceCharList
-
distinct
public MutableCharList distinct()
- Specified by:
distinct
in interfaceCharList
- Specified by:
distinct
in interfaceMutableCharList
- Specified by:
distinct
in interfaceReversibleCharIterable
-
subList
public MutableCharList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceCharList
- Specified by:
subList
in interfaceMutableCharList
-
zipChar
public MutableList<CharCharPair> zipChar(CharIterable iterable)
- Specified by:
zipChar
in interfaceCharList
- Specified by:
zipChar
in interfaceMutableCharList
- Since:
- 9.1.
-
newEmpty
public CharArrayList newEmpty()
Creates a new empty CharArrayList.- Specified by:
newEmpty
in interfaceMutableCharCollection
- Specified by:
newEmpty
in interfaceMutableCharList
- Since:
- 9.2.
-
zip
public <T> MutableList<CharObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zip
in interfaceCharList
- Specified by:
zip
in interfaceMutableCharList
- Since:
- 9.1.
-
boxed
public MutableList<Character> boxed()
- Specified by:
boxed
in interfaceMutableCharList
-
-