Top Description Fields Constructors Methods
org.eclipse.collections.impl.utility

public final Class ArrayListIterate

extends Object
Class Inheritance
Imports
java.lang.reflect.Field, java.util.ArrayList, .Collection, .Comparator, .Iterator, .List, .Optional, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, .Function3, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .DoubleObjectToDoubleFunction, .FloatFunction, .FloatObjectToFloatFunction, .IntFunction, .IntObjectToIntFunction, .LongFunction, .LongObjectToLongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.collection.primitive.MutableBooleanCollection, .MutableByteCollection, .MutableCharCollection, .MutableDoubleCollection, .MutableFloatCollection, .MutableIntCollection, .MutableLongCollection, .MutableShortCollection, org.eclipse.collections.api.factory.Lists, .Maps, .Sets, org.eclipse.collections.api.factory.primitive.BooleanLists, .ByteLists, .CharLists, .DoubleLists, .FloatLists, .IntLists, .LongLists, .ShortLists, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.list.primitive.MutableBooleanList, .MutableByteList, .MutableCharList, .MutableDoubleList, .MutableFloatList, .MutableIntList, .MutableLongList, .MutableShortList, org.eclipse.collections.api.map.MutableMap, .MutableMapIterable, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.partition.list.PartitionMutableList, org.eclipse.collections.api.set.MutableSet, org.eclipse.collections.api.tuple.Pair, .Twin, org.eclipse.collections.impl.block.factory.Comparators, .HashingStrategies, org.eclipse.collections.impl.block.procedure.MutatingAggregationProcedure, .NonMutatingAggregationProcedure, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.multimap.list.FastListMultimap, org.eclipse.collections.impl.partition.list.PartitionFastList, org.eclipse.collections.impl.set.strategy.mutable.UnifiedSetWithHashingStrategy, org.eclipse.collections.impl.tuple.Tuples, org.eclipse.collections.impl.utility.internal.InternalArrayIterate, .RandomAccessListIterate

This utility class provides optimized iteration pattern implementations that work with java.util.ArrayList.

Field Summary

Modifier and TypeField and Description
private static final Field
private static final int
private static final Field

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T, K, V> MutableMap<K, V>
aggregateBy(ArrayList<T> list, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)

public static <T, K, V> MutableMap<K, V>
aggregateInPlaceBy(ArrayList<T> list, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)

public static <T> boolean
allSatisfy(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, IV> boolean
allSatisfyWith(ArrayList<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T> boolean
anySatisfy(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> boolean
anySatisfyWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

private static boolean
public static <T, A> ArrayList<A>
collect(ArrayList<T> list, Function<? super T, ? extends A> function)

public static <T, A, R extends Collection<A>> R
collect(ArrayList<T> list, Function<? super T, ? extends A> function, R targetCollection)

public static <T> MutableBooleanList
collectBoolean(ArrayList<T> list, BooleanFunction<? super T> booleanFunction)

public static <T, R extends MutableBooleanCollection> R
collectBoolean(ArrayList<T> list, BooleanFunction<? super T> booleanFunction, R target)

private static <T, R extends MutableBooleanCollection> R
collectBooleanFromInternalArray(ArrayList<T> source, BooleanFunction<? super T> booleanFunction, int elementsToCollect, R target)

public static <T> MutableByteList
collectByte(ArrayList<T> list, ByteFunction<? super T> byteFunction)

public static <T, R extends MutableByteCollection> R
collectByte(ArrayList<T> list, ByteFunction<? super T> byteFunction, R target)

private static <T, R extends MutableByteCollection> R
collectByteFromInternalArray(ArrayList<T> source, ByteFunction<? super T> byteFunction, int elementsToCollect, R target)

public static <T> MutableCharList
collectChar(ArrayList<T> list, CharFunction<? super T> charFunction)

public static <T, R extends MutableCharCollection> R
collectChar(ArrayList<T> list, CharFunction<? super T> charFunction, R target)

private static <T, R extends MutableCharCollection> R
collectCharFromInternalArray(ArrayList<T> source, CharFunction<? super T> charFunction, int elementsToCollect, R target)

public static <T> MutableDoubleList
collectDouble(ArrayList<T> list, DoubleFunction<? super T> doubleFunction)

public static <T, R extends MutableDoubleCollection> R
collectDouble(ArrayList<T> list, DoubleFunction<? super T> doubleFunction, R target)

private static <T, R extends MutableDoubleCollection> R
collectDoubleFromInternalArray(ArrayList<T> source, DoubleFunction<? super T> doubleFunction, int elementsToCollect, R target)

public static <T> MutableFloatList
collectFloat(ArrayList<T> list, FloatFunction<? super T> floatFunction)

public static <T, R extends MutableFloatCollection> R
collectFloat(ArrayList<T> list, FloatFunction<? super T> floatFunction, R target)

private static <T, R extends MutableFloatCollection> R
collectFloatFromInternalArray(ArrayList<T> source, FloatFunction<? super T> floatFunction, int elementsToCollect, R target)

public static <T, A> ArrayList<A>
collectIf(ArrayList<T> list, Predicate<? super T> predicate, Function<? super T, ? extends A> function)

public static <T, A, R extends Collection<A>> R
collectIf(ArrayList<T> list, Predicate<? super T> predicate, Function<? super T, ? extends A> function, R targetCollection)

public static <T> MutableIntList
collectInt(ArrayList<T> list, IntFunction<? super T> intFunction)

public static <T, R extends MutableIntCollection> R
collectInt(ArrayList<T> list, IntFunction<? super T> intFunction, R target)

private static <T, R extends MutableIntCollection> R
collectIntFromInternalArray(ArrayList<T> source, IntFunction<? super T> intFunction, int elementsToCollect, R target)

public static <T> MutableLongList
collectLong(ArrayList<T> list, LongFunction<? super T> longFunction)

public static <T, R extends MutableLongCollection> R
collectLong(ArrayList<T> list, LongFunction<? super T> longFunction, R target)

private static <T, R extends MutableLongCollection> R
collectLongFromInternalArray(ArrayList<T> source, LongFunction<? super T> longFunction, int elementsToCollect, R target)

public static <T> MutableShortList
collectShort(ArrayList<T> list, ShortFunction<? super T> shortFunction)

public static <T, R extends MutableShortCollection> R
collectShort(ArrayList<T> list, ShortFunction<? super T> shortFunction, R target)

private static <T, R extends MutableShortCollection> R
collectShortFromInternalArray(ArrayList<T> source, ShortFunction<? super T> shortFunction, int elementsToCollect, R target)

public static <T, P, A> ArrayList<A>
collectWith(ArrayList<T> list, Function2<? super T, ? super P, ? extends A> function, P parameter)

public static <T, P, A, R extends Collection<A>> R
collectWith(ArrayList<T> list, Function2<? super T, ? super P, ? extends A> function, P parameter, R targetCollection)

public static <T> int
count(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> int
countWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> T
detect(ArrayList<T> list, Predicate<? super T> predicate)

public static <T> T
detectIfNone(ArrayList<T> list, Predicate<? super T> predicate, T ifNone)

public static <T> int
detectIndex(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> int
detectIndexWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> int
detectLastIndex(ArrayList<T> list, Predicate<? super T> predicate)

public static <T> Optional<T>
detectOptional(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> T
detectWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T, IV> T
detectWithIfNone(ArrayList<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue, T ifNone)

public static <T, P> Optional<T>
detectWithOptional(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> ArrayList<T>
public static <T, R extends List<T>> R
distinct(ArrayList<T> list, R targetList)
Deprecated in 7.0.

public static <T> ArrayList<T>
distinct(ArrayList<T> list, HashingStrategy<? super T> hashingStrategy)

public static <T, V> ArrayList<T>
distinctBy(ArrayList<T> list, Function<? super T, ? extends V> function)

public static <T> ArrayList<T>
drop(ArrayList<T> list, int count)

public static <T, R extends Collection<T>> R
drop(ArrayList<T> list, int count, R targetList)

public static <T> MutableList<T>
dropWhile(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, A> ArrayList<A>
flatCollect(ArrayList<T> list, Function<? super T, ? extends Iterable<A>> function)

public static <T, A, R extends Collection<A>> R
flatCollect(ArrayList<T> list, Function<? super T, ? extends Iterable<A>> function, R targetCollection)

public static <T> void
forEach(ArrayList<T> list, Procedure<? super T> procedure)

public static <T> void
forEach(ArrayList<T> list, int from, int to, Procedure<? super T> procedure)

Iterates over the section of the list covered by the specified indexes.

public static <T1, T2> void
forEachInBoth(ArrayList<T1> list1, ArrayList<T2> list2, Procedure2<? super T1, ? super T2> procedure)

public static <T, P> void
forEachWith(ArrayList<T> list, Procedure2<? super T, ? super P> procedure, P parameter)

public static <T> void
forEachWithIndex(ArrayList<T> list, int from, int to, ObjectIntProcedure<? super T> objectIntProcedure)

Iterates over the section of the list covered by the specified indexes.

public static <T> void
forEachWithIndex(ArrayList<T> list, ObjectIntProcedure<? super T> objectIntProcedure)

private static <T> T[]
public static <T, V> FastListMultimap<V, T>
groupBy(ArrayList<T> list, Function<? super T, ? extends V> function)

public static <T, V, R extends MutableMultimap<V, T>> R
groupBy(ArrayList<T> list, Function<? super T, ? extends V> function, R target)

public static <T, V> FastListMultimap<V, T>
groupByEach(ArrayList<T> list, Function<? super T, ? extends Iterable<V>> function)

public static <T, V, R extends MutableMultimap<V, T>> R
groupByEach(ArrayList<T> list, Function<? super T, ? extends Iterable<V>> function, R target)

public static <T, V> MutableMap<V, T>
groupByUniqueKey(ArrayList<T> list, Function<? super T, ? extends V> function)

public static <T, V, R extends MutableMapIterable<V, T>> R
groupByUniqueKey(ArrayList<T> list, Function<? super T, ? extends V> function, R target)

public static <T, IV> IV
injectInto(IV injectValue, ArrayList<T> list, Function2<? super IV, ? super T, ? extends IV> function)

public static <T> int
injectInto(int injectValue, ArrayList<T> list, IntObjectToIntFunction<? super T> function)

public static <T> long
injectInto(long injectValue, ArrayList<T> list, LongObjectToLongFunction<? super T> function)

public static <T> double
injectInto(double injectValue, ArrayList<T> list, DoubleObjectToDoubleFunction<? super T> function)

public static <T> float
injectInto(float injectValue, ArrayList<T> list, FloatObjectToFloatFunction<? super T> function)

public static <T, IV, P> IV
injectIntoWith(IV injectedValue, ArrayList<T> list, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)

private static boolean
isOptimizableArrayList(ArrayList<?> list, int newSize)

public static <T> boolean
noneSatisfy(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, IV> boolean
noneSatisfyWith(ArrayList<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T> PartitionMutableList<T>
partition(ArrayList<T> list, Predicate<? super T> predicate)

public static <T> PartitionMutableList<T>
partitionWhile(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> PartitionMutableList<T>
partitionWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> ArrayList<T>
reject(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, R extends Collection<T>> R
reject(ArrayList<T> list, Predicate<? super T> predicate, R targetCollection)

public static <T, IV> ArrayList<T>
rejectWith(ArrayList<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T, P, R extends Collection<T>> R
rejectWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P injectedValue, R targetCollection)

public static <T> boolean
removeIf(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, P> boolean
removeIfWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> void
reverseForEach(ArrayList<T> list, Procedure<? super T> procedure)

Reverses over the List in reverse order executing the Procedure for each element.

public static <T> void
reverseForEachWithIndex(ArrayList<T> list, ObjectIntProcedure<? super T> procedure)

Reverses over the List in reverse order executing the Procedure with index for each element.

public static <T> ArrayList<T>
select(ArrayList<T> list, Predicate<? super T> predicate)

public static <T, R extends Collection<T>> R
select(ArrayList<T> list, Predicate<? super T> predicate, R targetCollection)

public static <T, P> Twin<MutableList<T>>
selectAndRejectWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> MutableList<T>
selectInstancesOf(ArrayList<?> list, Class<T> clazz)

public static <T, IV> ArrayList<T>
selectWith(ArrayList<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T, P, R extends Collection<T>> R
selectWith(ArrayList<T> list, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection)

public static <T extends Comparable<? super T>> ArrayList<T>
sortThis(ArrayList<T> list)

Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList.

public static <T> ArrayList<T>
sortThis(ArrayList<T> list, Comparator<? super T> comparator)

Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList.

public static <T> ArrayList<T>
take(ArrayList<T> list, int count)

public static <T, R extends Collection<T>> R
take(ArrayList<T> list, int count, R targetList)

public static <T> MutableList<T>
takeWhile(ArrayList<T> list, Predicate<? super T> predicate)

public static <T> void
toArray(ArrayList<T> list, T[] target, int startIndex, int sourceSize)

private static <T> void
wipeAndResetTheEnd(int newCurrentFilledIndex, int newSize, T[] newElements, ArrayList<T> list)

public static <X, Y> MutableList<Pair<X, Y>>
zip(ArrayList<X> xs, Iterable<Y> ys)

public static <X, Y, R extends Collection<Pair<X, Y>>> R
zip(ArrayList<X> xs, Iterable<Y> ys, R targetCollection)

public static <T> MutableList<Pair<T, Integer>>
public static <T, R extends Collection<Pair<T, Integer>>> R
zipWithIndex(ArrayList<T> list, R targetCollection)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait