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 booleanadd(char newItem)booleanaddAll(char... source)booleanaddAll(CharIterable source)booleanaddAllAtIndex(int index, char... source)booleanaddAllAtIndex(int index, CharIterable source)voidaddAtIndex(int index, char element)booleanallSatisfy(CharPredicate predicate)booleananySatisfy(CharPredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)LazyCharIterableasReversed()MutableCharListasSynchronized()MutableCharListasUnmodifiable()intbinarySearch(char value)MutableList<Character>boxed()MutableCharIteratorcharIterator()RichIterable<CharIterable>chunk(int size)voidclear()<V> MutableList<V>collect(CharToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(CharToObjectFunction<? extends V> function, R target)booleancontains(char value)intcount(CharPredicate predicate)chardetectIfNone(CharPredicate predicate, char ifNone)MutableCharListdistinct()longdotProduct(CharList list)voideach(CharProcedure procedure)voidensureCapacity(int minCapacity)booleanequals(Object otherList)voidforEachWithIndex(CharIntProcedure procedure)charget(int index)chargetFirst()chargetLast()inthashCode()intindexOf(char value)<T> TinjectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(char value)charmax()charmin()CharArrayListnewEmpty()Creates a new empty CharArrayList.static CharArrayListnewList(CharIterable source)static CharArrayListnewListWith(char... elements)Creates a new list using the passedelementsargument as the backing store.static CharArrayListnewWithNValues(int size, char value)voidreadExternal(ObjectInput in)CharArrayListreject(CharPredicate predicate)<R extends MutableCharCollection>
Rreject(CharPredicate predicate, R target)booleanremove(char value)booleanremoveAll(char... source)booleanremoveAll(CharIterable source)charremoveAtIndex(int index)booleanremoveIf(CharPredicate predicate)booleanretainAll(char... source)booleanretainAll(CharIterable source)CharArrayListreverseThis()CharArrayListselect(CharPredicate predicate)<R extends MutableCharCollection>
Rselect(CharPredicate predicate, R target)charset(int index, char element)intsize()CharArrayListsortThis()CharArrayListsortThis(CharComparator comparator)MutableCharListsubList(int fromIndex, int toIndex)longsum()voidswap(int index1, int index2)char[]toArray()char[]toArray(char[] target)ImmutableCharListtoImmutable()CharArrayListtoReversed()voidtrimToSize()CharArrayListwith(char element)CharArrayListwith(char element1, char element2)CharArrayListwith(char element1, char element2, char element3)CharArrayListwith(char element1, char element2, char element3, char... elements)CharArrayListwithAll(CharIterable elements)CharArrayListwithout(char element)CharArrayListwithoutAll(CharIterable elements)static CharArrayListwrapCopy(char... array)Creates a new list by first copying the array passed in.voidwriteExternal(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 passedelementsargument 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:
sizein interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin interfaceMutableCharCollection
-
contains
public boolean contains(char value)
- Specified by:
containsin interfaceCharIterable
-
getFirst
public char getFirst()
- Specified by:
getFirstin interfaceOrderedCharIterable
-
getLast
public char getLast()
- Specified by:
getLastin interfaceReversibleCharIterable
-
indexOf
public int indexOf(char value)
- Specified by:
indexOfin interfaceOrderedCharIterable
-
lastIndexOf
public int lastIndexOf(char value)
- Specified by:
lastIndexOfin interfaceCharList
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(char newItem)
- Specified by:
addin interfaceMutableCharCollection
-
addAll
public boolean addAll(char... source)
- Specified by:
addAllin interfaceMutableCharCollection
-
addAll
public boolean addAll(CharIterable source)
- Specified by:
addAllin interfaceMutableCharCollection
-
addAtIndex
public void addAtIndex(int index, char element)- Specified by:
addAtIndexin interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, char... source)- Specified by:
addAllAtIndexin interfaceMutableCharList
-
addAllAtIndex
public boolean addAllAtIndex(int index, CharIterable source)- Specified by:
addAllAtIndexin interfaceMutableCharList
-
remove
public boolean remove(char value)
- Specified by:
removein interfaceMutableCharCollection
-
removeIf
public boolean removeIf(CharPredicate predicate)
- Specified by:
removeIfin interfaceMutableCharCollection
-
removeAll
public boolean removeAll(CharIterable source)
- Specified by:
removeAllin interfaceMutableCharCollection
-
removeAll
public boolean removeAll(char... source)
- Specified by:
removeAllin interfaceMutableCharCollection
-
retainAll
public boolean retainAll(CharIterable source)
- Specified by:
retainAllin interfaceMutableCharCollection
-
retainAll
public boolean retainAll(char... source)
- Specified by:
retainAllin interfaceMutableCharCollection
-
removeAtIndex
public char removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableCharList
-
set
public char set(int index, char element)- Specified by:
setin interfaceMutableCharList
-
swap
public void swap(int index1, int index2)- Specified by:
swapin interfaceMutableCharList
-
with
public CharArrayList with(char element)
- Specified by:
within interfaceMutableCharCollection- Specified by:
within interfaceMutableCharList
-
without
public CharArrayList without(char element)
- Specified by:
withoutin interfaceMutableCharCollection- Specified by:
withoutin interfaceMutableCharList
-
withAll
public CharArrayList withAll(CharIterable elements)
- Specified by:
withAllin interfaceMutableCharCollection- Specified by:
withAllin interfaceMutableCharList
-
withoutAll
public CharArrayList withoutAll(CharIterable elements)
- Specified by:
withoutAllin interfaceMutableCharCollection- Specified by:
withoutAllin 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:
charIteratorin interfaceCharIterable- Specified by:
charIteratorin interfaceMutableCharCollection
-
each
public void each(CharProcedure procedure)
- Specified by:
eachin interfaceCharIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(CharIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedCharIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceCharIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectCharIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedCharIterable- Specified by:
injectIntoWithIndexin interfaceReversibleCharIterable
-
chunk
public RichIterable<CharIterable> chunk(int size)
- Specified by:
chunkin interfaceCharIterable
-
count
public int count(CharPredicate predicate)
- Specified by:
countin interfaceCharIterable
-
anySatisfy
public boolean anySatisfy(CharPredicate predicate)
- Specified by:
anySatisfyin interfaceCharIterable
-
allSatisfy
public boolean allSatisfy(CharPredicate predicate)
- Specified by:
allSatisfyin interfaceCharIterable
-
select
public CharArrayList select(CharPredicate predicate)
- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceCharList- Specified by:
selectin interfaceMutableCharCollection- Specified by:
selectin interfaceMutableCharList- Specified by:
selectin interfaceOrderedCharIterable- Specified by:
selectin interfaceReversibleCharIterable
-
select
public <R extends MutableCharCollection> R select(CharPredicate predicate, R target)
- Specified by:
selectin interfaceCharIterable- Since:
- 8.1.
-
reject
public CharArrayList reject(CharPredicate predicate)
- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceCharList- Specified by:
rejectin interfaceMutableCharCollection- Specified by:
rejectin interfaceMutableCharList- Specified by:
rejectin interfaceOrderedCharIterable- Specified by:
rejectin interfaceReversibleCharIterable
-
reject
public <R extends MutableCharCollection> R reject(CharPredicate predicate, R target)
- Specified by:
rejectin interfaceCharIterable- Since:
- 8.1.
-
detectIfNone
public char detectIfNone(CharPredicate predicate, char ifNone)
- Specified by:
detectIfNonein interfaceCharIterable
-
collect
public <V> MutableList<V> collect(CharToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceCharIterable- Specified by:
collectin interfaceCharList- Specified by:
collectin interfaceMutableCharCollection- Specified by:
collectin interfaceMutableCharList- Specified by:
collectin interfaceOrderedCharIterable- Specified by:
collectin interfaceReversibleCharIterable
-
collect
public <V,R extends Collection<V>> R collect(CharToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceCharIterable- Since:
- 8.1.
-
max
public char max()
- Specified by:
maxin interfaceCharIterable
-
min
public char min()
- Specified by:
minin interfaceCharIterable
-
sum
public long sum()
- Specified by:
sumin interfaceCharIterable
-
dotProduct
public long dotProduct(CharList list)
- Specified by:
dotProductin interfaceCharList
-
toArray
public char[] toArray()
- Specified by:
toArrayin interfaceCharIterable
-
toArray
public char[] toArray(char[] target)
- Specified by:
toArrayin 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:
appendStringin interfacePrimitiveIterable
-
asUnmodifiable
public MutableCharList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableCharCollection- Specified by:
asUnmodifiablein interfaceMutableCharList
-
asSynchronized
public MutableCharList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableCharCollection- Specified by:
asSynchronizedin interfaceMutableCharList
-
toImmutable
public ImmutableCharList toImmutable()
- Specified by:
toImmutablein interfaceCharList- Specified by:
toImmutablein interfaceMutableCharCollection- Specified by:
toImmutablein interfaceMutableCharList
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
asReversed
public LazyCharIterable asReversed()
- Specified by:
asReversedin interfaceReversibleCharIterable
-
reverseThis
public CharArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableCharList
-
sortThis
public CharArrayList sortThis()
- Specified by:
sortThisin interfaceMutableCharList
-
sortThis
public CharArrayList sortThis(CharComparator comparator)
- Specified by:
sortThisin interfaceMutableCharList
-
toReversed
public CharArrayList toReversed()
- Specified by:
toReversedin interfaceCharList- Specified by:
toReversedin interfaceMutableCharList- Specified by:
toReversedin interfaceReversibleCharIterable
-
binarySearch
public int binarySearch(char value)
- Specified by:
binarySearchin interfaceCharList
-
distinct
public MutableCharList distinct()
- Specified by:
distinctin interfaceCharList- Specified by:
distinctin interfaceMutableCharList- Specified by:
distinctin interfaceReversibleCharIterable
-
subList
public MutableCharList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceCharList- Specified by:
subListin interfaceMutableCharList
-
zipChar
public MutableList<CharCharPair> zipChar(CharIterable iterable)
- Specified by:
zipCharin interfaceCharList- Specified by:
zipCharin interfaceMutableCharList- Since:
- 9.1.
-
newEmpty
public CharArrayList newEmpty()
Creates a new empty CharArrayList.- Specified by:
newEmptyin interfaceMutableCharCollection- Specified by:
newEmptyin interfaceMutableCharList- Since:
- 9.2.
-
zip
public <T> MutableList<CharObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceCharList- Specified by:
zipin interfaceMutableCharList- Since:
- 9.1.
-
boxed
public MutableList<Character> boxed()
- Specified by:
boxedin interfaceMutableCharList
-
-