Class IntArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractIntIterable
-
- org.eclipse.collections.impl.list.mutable.primitive.IntArrayList
-
- All Implemented Interfaces:
Externalizable,Serializable,MutableIntCollection,IntIterable,IntList,MutableIntList,OrderedIntIterable,ReversibleIntIterable,PrimitiveIterable
public class IntArrayList extends AbstractIntIterable implements MutableIntList, Externalizable
IntArrayList is similar to FastList, and is memory-optimized for int primitives. This file was automatically generated from template file primitiveArrayList.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntArrayList()IntArrayList(int initialCapacity)IntArrayList(int... array)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(int newItem)booleanaddAll(int... source)booleanaddAll(IntIterable source)booleanaddAllAtIndex(int index, int... source)booleanaddAllAtIndex(int index, IntIterable source)voidaddAtIndex(int index, int element)booleanallSatisfy(IntPredicate predicate)booleananySatisfy(IntPredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)LazyIntIterableasReversed()MutableIntListasSynchronized()MutableIntListasUnmodifiable()intbinarySearch(int value)MutableList<Integer>boxed()RichIterable<IntIterable>chunk(int size)voidclear()<V> MutableList<V>collect(IntToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(IntToObjectFunction<? extends V> function, R target)booleancontains(int value)intcount(IntPredicate predicate)intdetectIfNone(IntPredicate predicate, int ifNone)MutableIntListdistinct()longdotProduct(IntList list)voideach(IntProcedure procedure)voidensureCapacity(int minCapacity)booleanequals(Object otherList)voidforEachWithIndex(IntIntProcedure procedure)intget(int index)intgetFirst()intgetLast()inthashCode()intindexOf(int value)<T> TinjectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)MutableIntIteratorintIterator()intlastIndexOf(int value)intmax()intmin()IntArrayListnewEmpty()Creates a new empty IntArrayList.static IntArrayListnewList(IntIterable source)static IntArrayListnewListWith(int... elements)Creates a new list using the passedelementsargument as the backing store.static IntArrayListnewWithNValues(int size, int value)voidreadExternal(ObjectInput in)IntArrayListreject(IntPredicate predicate)<R extends MutableIntCollection>
Rreject(IntPredicate predicate, R target)booleanremove(int value)booleanremoveAll(int... source)booleanremoveAll(IntIterable source)intremoveAtIndex(int index)booleanremoveIf(IntPredicate predicate)booleanretainAll(int... source)booleanretainAll(IntIterable source)IntArrayListreverseThis()IntArrayListselect(IntPredicate predicate)<R extends MutableIntCollection>
Rselect(IntPredicate predicate, R target)intset(int index, int element)intsize()IntArrayListsortThis()IntArrayListsortThis(IntComparator comparator)Spliterator.OfIntspliterator()MutableIntListsubList(int fromIndex, int toIndex)longsum()voidswap(int index1, int index2)int[]toArray()int[]toArray(int[] target)ImmutableIntListtoImmutable()IntArrayListtoReversed()voidtrimToSize()IntArrayListwith(int element)IntArrayListwith(int element1, int element2)IntArrayListwith(int element1, int element2, int element3)IntArrayListwith(int element1, int element2, int element3, int... elements)IntArrayListwithAll(IntIterable elements)IntArrayListwithout(int element)IntArrayListwithoutAll(IntIterable elements)static IntArrayListwrapCopy(int... array)Creates a new list by first copying the array passed in.voidwriteExternal(ObjectOutput out)<T> MutableList<IntObjectPair<T>>zip(Iterable<T> iterable)MutableList<IntIntPair>zipInt(IntIterable iterable)-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
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.IntList
forEachInBoth, primitiveParallelStream, primitiveStream
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableIntList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
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 IntArrayList newListWith(int... 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 IntArrayList newList(IntIterable source)
-
newWithNValues
public static IntArrayList newWithNValues(int size, int value)
-
wrapCopy
public static IntArrayList wrapCopy(int... 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 interfaceMutableIntCollection
-
contains
public boolean contains(int value)
- Specified by:
containsin interfaceIntIterable
-
getFirst
public int getFirst()
- Specified by:
getFirstin interfaceOrderedIntIterable
-
getLast
public int getLast()
- Specified by:
getLastin interfaceReversibleIntIterable
-
indexOf
public int indexOf(int value)
- Specified by:
indexOfin interfaceOrderedIntIterable
-
lastIndexOf
public int lastIndexOf(int value)
- Specified by:
lastIndexOfin interfaceIntList
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(int newItem)
- Specified by:
addin interfaceMutableIntCollection
-
addAll
public boolean addAll(int... source)
- Specified by:
addAllin interfaceMutableIntCollection
-
addAll
public boolean addAll(IntIterable source)
- Specified by:
addAllin interfaceMutableIntCollection
-
addAtIndex
public void addAtIndex(int index, int element)- Specified by:
addAtIndexin interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, int... source)- Specified by:
addAllAtIndexin interfaceMutableIntList
-
addAllAtIndex
public boolean addAllAtIndex(int index, IntIterable source)- Specified by:
addAllAtIndexin interfaceMutableIntList
-
remove
public boolean remove(int value)
- Specified by:
removein interfaceMutableIntCollection
-
removeIf
public boolean removeIf(IntPredicate predicate)
- Specified by:
removeIfin interfaceMutableIntCollection
-
removeAll
public boolean removeAll(IntIterable source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
removeAll
public boolean removeAll(int... source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(IntIterable source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(int... source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
removeAtIndex
public int removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableIntList
-
set
public int set(int index, int element)- Specified by:
setin interfaceMutableIntList
-
swap
public void swap(int index1, int index2)- Specified by:
swapin interfaceMutableIntList
-
with
public IntArrayList with(int element)
- Specified by:
within interfaceMutableIntCollection- Specified by:
within interfaceMutableIntList
-
without
public IntArrayList without(int element)
- Specified by:
withoutin interfaceMutableIntCollection- Specified by:
withoutin interfaceMutableIntList
-
withAll
public IntArrayList withAll(IntIterable elements)
- Specified by:
withAllin interfaceMutableIntCollection- Specified by:
withAllin interfaceMutableIntList
-
withoutAll
public IntArrayList withoutAll(IntIterable elements)
- Specified by:
withoutAllin interfaceMutableIntCollection- Specified by:
withoutAllin interfaceMutableIntList
-
with
public IntArrayList with(int element1, int element2)
-
with
public IntArrayList with(int element1, int element2, int element3)
-
with
public IntArrayList with(int element1, int element2, int element3, int... elements)
-
intIterator
public MutableIntIterator intIterator()
- Specified by:
intIteratorin interfaceIntIterable- Specified by:
intIteratorin interfaceMutableIntCollection
-
each
public void each(IntProcedure procedure)
- Specified by:
eachin interfaceIntIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(IntIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedIntIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceIntIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectIntIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedIntIterable- Specified by:
injectIntoWithIndexin interfaceReversibleIntIterable
-
chunk
public RichIterable<IntIterable> chunk(int size)
- Specified by:
chunkin interfaceIntIterable
-
count
public int count(IntPredicate predicate)
- Specified by:
countin interfaceIntIterable
-
anySatisfy
public boolean anySatisfy(IntPredicate predicate)
- Specified by:
anySatisfyin interfaceIntIterable
-
allSatisfy
public boolean allSatisfy(IntPredicate predicate)
- Specified by:
allSatisfyin interfaceIntIterable
-
select
public IntArrayList select(IntPredicate predicate)
- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntList- Specified by:
selectin interfaceMutableIntCollection- Specified by:
selectin interfaceMutableIntList- Specified by:
selectin interfaceOrderedIntIterable- Specified by:
selectin interfaceReversibleIntIterable
-
select
public <R extends MutableIntCollection> R select(IntPredicate predicate, R target)
- Specified by:
selectin interfaceIntIterable- Since:
- 8.1.
-
reject
public IntArrayList reject(IntPredicate predicate)
- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntList- Specified by:
rejectin interfaceMutableIntCollection- Specified by:
rejectin interfaceMutableIntList- Specified by:
rejectin interfaceOrderedIntIterable- Specified by:
rejectin interfaceReversibleIntIterable
-
reject
public <R extends MutableIntCollection> R reject(IntPredicate predicate, R target)
- Specified by:
rejectin interfaceIntIterable- Since:
- 8.1.
-
detectIfNone
public int detectIfNone(IntPredicate predicate, int ifNone)
- Specified by:
detectIfNonein interfaceIntIterable
-
collect
public <V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceIntList- Specified by:
collectin interfaceMutableIntCollection- Specified by:
collectin interfaceMutableIntList- Specified by:
collectin interfaceOrderedIntIterable- Specified by:
collectin interfaceReversibleIntIterable
-
collect
public <V,R extends Collection<V>> R collect(IntToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceIntIterable- Since:
- 8.1.
-
max
public int max()
- Specified by:
maxin interfaceIntIterable
-
min
public int min()
- Specified by:
minin interfaceIntIterable
-
sum
public long sum()
- Specified by:
sumin interfaceIntIterable
-
dotProduct
public long dotProduct(IntList list)
- Specified by:
dotProductin interfaceIntList
-
toArray
public int[] toArray()
- Specified by:
toArrayin interfaceIntIterable
-
toArray
public int[] toArray(int[] target)
- Specified by:
toArrayin interfaceIntIterable
-
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 MutableIntList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Specified by:
asUnmodifiablein interfaceMutableIntList
-
asSynchronized
public MutableIntList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntCollection- Specified by:
asSynchronizedin interfaceMutableIntList
-
toImmutable
public ImmutableIntList toImmutable()
- Specified by:
toImmutablein interfaceIntList- Specified by:
toImmutablein interfaceMutableIntCollection- Specified by:
toImmutablein interfaceMutableIntList
-
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 LazyIntIterable asReversed()
- Specified by:
asReversedin interfaceReversibleIntIterable
-
reverseThis
public IntArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableIntList
-
sortThis
public IntArrayList sortThis()
- Specified by:
sortThisin interfaceMutableIntList
-
sortThis
public IntArrayList sortThis(IntComparator comparator)
- Specified by:
sortThisin interfaceMutableIntList
-
toReversed
public IntArrayList toReversed()
- Specified by:
toReversedin interfaceIntList- Specified by:
toReversedin interfaceMutableIntList- Specified by:
toReversedin interfaceReversibleIntIterable
-
binarySearch
public int binarySearch(int value)
- Specified by:
binarySearchin interfaceIntList
-
distinct
public MutableIntList distinct()
- Specified by:
distinctin interfaceIntList- Specified by:
distinctin interfaceMutableIntList- Specified by:
distinctin interfaceReversibleIntIterable
-
subList
public MutableIntList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceIntList- Specified by:
subListin interfaceMutableIntList
-
zipInt
public MutableList<IntIntPair> zipInt(IntIterable iterable)
- Specified by:
zipIntin interfaceIntList- Specified by:
zipIntin interfaceMutableIntList- Since:
- 9.1.
-
newEmpty
public IntArrayList newEmpty()
Creates a new empty IntArrayList.- Specified by:
newEmptyin interfaceMutableIntCollection- Specified by:
newEmptyin interfaceMutableIntList- Since:
- 9.2.
-
zip
public <T> MutableList<IntObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceIntList- Specified by:
zipin interfaceMutableIntList- Since:
- 9.1.
-
boxed
public MutableList<Integer> boxed()
- Specified by:
boxedin interfaceMutableIntList
-
spliterator
public Spliterator.OfInt spliterator()
- Specified by:
spliteratorin interfaceIntList
-
-