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

public final Class IterableIterate

extends Object
Class Inheritance
Imports
java.io.IOException, java.math.BigDecimal, .BigInteger, java.util.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.MutableCollection, org.eclipse.collections.api.collection.primitive.MutableBooleanCollection, .MutableByteCollection, .MutableCharCollection, .MutableDoubleCollection, .MutableFloatCollection, .MutableIntCollection, .MutableLongCollection, .MutableShortCollection, org.eclipse.collections.api.factory.Maps, org.eclipse.collections.api.factory.primitive.ObjectDoubleMaps, .ObjectLongMaps, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.MutableMap, .MutableMapIterable, org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap, .MutableObjectLongMap, .ObjectDoubleMap, .ObjectLongMap, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.partition.PartitionMutableCollection, org.eclipse.collections.api.partition.list.PartitionMutableList, org.eclipse.collections.api.tuple.Pair, .Twin, org.eclipse.collections.impl.block.factory.Comparators, .PrimitiveFunctions, org.eclipse.collections.impl.list.mutable.FastList, org.eclipse.collections.impl.multimap.list.FastListMultimap, org.eclipse.collections.impl.utility.Iterate

The IterableIterate class provides a few of the methods from the Smalltalk Collection Protocol for use with general Collection classes. This includes do:, select:, reject:, collect:, inject:into:, detect:, detect:ifNone:, anySatisfy: and allSatisfy:

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T, K, V> MutableMap<K, V>
aggregateBy(Iterable<T> iterable, 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(Iterable<T> iterable, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)

public static <T> boolean
allSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, P> boolean
allSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)

public static <T> boolean
anySatisfy(Iterable<T> iterable, Predicate<? super T> predicate)

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

public static <T> void
appendString(Iterable<T> iterable, Appendable appendable, String start, String separator, String end)

public static <T> RichIterable<RichIterable<T>>
chunk(Iterable<T> iterable, int size)

public static <T, V> MutableList<V>
collect(Iterable<T> iterable, Function<? super T, ? extends V> function)

public static <T, V, R extends Collection<V>> R
collect(Iterable<T> iterable, Function<? super T, ? extends V> function, R targetCollection)

public static <T> MutableBooleanCollection
collectBoolean(Iterable<T> iterable, BooleanFunction<? super T> booleanFunction)

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

public static <T> MutableByteCollection
collectByte(Iterable<T> iterable, ByteFunction<? super T> byteFunction)

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

public static <T> MutableCharCollection
collectChar(Iterable<T> iterable, CharFunction<? super T> charFunction)

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

public static <T> MutableDoubleCollection
collectDouble(Iterable<T> iterable, DoubleFunction<? super T> doubleFunction)

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

public static <T> MutableFloatCollection
collectFloat(Iterable<T> iterable, FloatFunction<? super T> floatFunction)

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

public static <T, V> MutableList<V>
collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T, ? extends V> function)

public static <T, V, R extends Collection<V>> R
collectIf(Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T, ? extends V> function, R targetCollection)

public static <T> MutableIntCollection
collectInt(Iterable<T> iterable, IntFunction<? super T> intFunction)

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

public static <T> MutableLongCollection
collectLong(Iterable<T> iterable, LongFunction<? super T> longFunction)

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

public static <T> MutableShortCollection
collectShort(Iterable<T> iterable, ShortFunction<? super T> shortFunction)

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

public static <T, P, V> MutableList<V>
collectWith(Iterable<T> iterable, Function2<? super T, ? super P, ? extends V> function, P parameter)

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

public static <T> int
count(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, IV> int
countWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T> T
detect(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T> int
detectIndex(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, IV> int
detectIndexWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T> Optional<T>
detectOptional(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, P> T
detectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)

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

public static <T, R extends List<T>> R
distinct(Iterable<T> iterable, R targetCollection)
Deprecated in 7.0.

public static <T> MutableList<T>
distinct(Iterable<T> iterable)

public static <T> MutableList<T>
distinct(Iterable<T> iterable, HashingStrategy<? super T> hashingStrategy)

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

public static <T, R extends Collection<T>> R
drop(Iterable<T> iterable, int count, R targetCollection)

public static <T, R extends MutableCollection<T>> R
dropWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)

public static <T, V> MutableList<V>
flatCollect(Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function)

public static <T, V, R extends Collection<V>> R
flatCollect(Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function, R targetCollection)

public static <T> void
forEach(Iterable<T> iterable, Procedure<? super T> procedure)

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

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

public static <T> void
forEachWithIndex(Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure)

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

public static <T> T
getFirst(Iterable<T> iterable)

public static <T> T
getLast(Iterable<T> iterable)

public static <T> T
getOnly(Iterable<T> iterable)

public static <T, V> FastListMultimap<V, T>
groupBy(Iterable<T> iterable, Function<? super T, ? extends V> function)

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

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

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

public static <K, T> MutableMap<K, T>
groupByUniqueKey(Iterable<T> iterable, Function<? super T, ? extends K> function)

public static <K, T, R extends MutableMapIterable<K, T>> R
groupByUniqueKey(Iterable<T> iterable, Function<? super T, ? extends K> function, R target)

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

public static <T> int
injectInto(int injectValue, Iterable<T> iterable, IntObjectToIntFunction<? super T> function)

public static <T> long
injectInto(long injectValue, Iterable<T> iterable, LongObjectToLongFunction<? super T> function)

public static <T> double
injectInto(double injectValue, Iterable<T> iterable, DoubleObjectToDoubleFunction<? super T> function)

public static <T> float
injectInto(float injectValue, Iterable<T> iterable, FloatObjectToFloatFunction<? super T> function)

public static <T, IV, P> IV
injectIntoWith(IV injectValue, Iterable<T> iterable, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)

public static boolean
isEmpty(Iterable<?> iterable)

public static <T> T
max(Iterable<T> iterable, Comparator<? super T> comparator)

public static <T> T
max(Iterable<T> iterable)

public static <T, V extends Comparable<? super V>> T
maxBy(Iterable<T> iterable, Function<? super T, ? extends V> function)

public static <T> T
min(Iterable<T> iterable, Comparator<? super T> comparator)

public static <T> T
min(Iterable<T> iterable)

public static <T, V extends Comparable<? super V>> T
minBy(Iterable<T> iterable, Function<? super T, ? extends V> function)

public static <T> boolean
noneSatisfy(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, P> boolean
noneSatisfyWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter)

public static boolean
notEmpty(Iterable<?> iterable)

public static <T> PartitionMutableList<T>
partition(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T, R extends PartitionMutableCollection<T>> R
partitionWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)

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

public static <T> MutableList<T>
reject(Iterable<T> iterable, Predicate<? super T> predicate)

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

public static <T, P, R extends Collection<T>> R
rejectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection)

public static <T> boolean
removeIf(Iterable<T> iterable, Predicate<? super T> predicate)

public static <T> boolean
removeIf(Iterable<T> iterable, Predicate<? super T> predicate, Procedure<? super T> procedure)

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

public static <T, P> boolean
removeIfWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, Procedure<? super T> procedure)

public static <T> MutableList<T>
select(Iterable<T> iterable, Predicate<? super T> predicate)

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

public static <T, IV> Twin<MutableList<T>>
selectAndRejectWith(Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue)

public static <T> MutableList<T>
selectInstancesOf(Iterable<?> iterable, Class<T> clazz)

public static <T, R extends Collection<T>> R
selectInstancesOf(Iterable<?> iterable, Class<T> clazz, R targetCollection)

public static <T, P, R extends Collection<T>> R
selectWith(Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P injectedValue, R targetCollection)

public static <T> String
stringValueOfItem(Iterable<T> iterable, T item)

public static <V, T> MutableMap<V, BigDecimal>
sumByBigDecimal(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, Function<? super T, BigDecimal> function)

public static <V, T> MutableMap<V, BigInteger>
sumByBigInteger(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function)

public static <V, T> ObjectDoubleMap<V>
sumByDouble(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, DoubleFunction<? super T> function)

public static <V, T> ObjectDoubleMap<V>
sumByFloat(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, FloatFunction<? super T> function)

public static <V, T> ObjectLongMap<V>
sumByInt(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, IntFunction<? super T> function)

public static <V, T> ObjectLongMap<V>
sumByLong(Iterable<T> iterable, Function<? super T, ? extends V> groupBy, LongFunction<? super T> function)

public static <T> BigDecimal
sumOfBigDecimal(Iterable<T> iterable, Function<? super T, BigDecimal> function)

public static <T> BigInteger
sumOfBigInteger(Iterable<T> iterable, Function<? super T, BigInteger> function)

public static <T> double
sumOfDouble(Iterable<T> iterable, DoubleFunction<? super T> function)

public static <T> double
sumOfFloat(Iterable<T> iterable, FloatFunction<? super T> function)

public static <T> long
sumOfInt(Iterable<T> iterable, IntFunction<? super T> function)

public static <T> long
sumOfLong(Iterable<T> iterable, LongFunction<? super T> function)

public static <T> Collection<T>
take(Iterable<T> iterable, int count)

public static <T, R extends Collection<T>> R
take(Iterable<T> iterable, int count, R targetCollection)

public static <T, R extends MutableCollection<T>> R
takeWhile(Iterable<T> iterable, Predicate<? super T> predicate, R target)

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

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

public static <T> MutableList<Pair<T, Integer>>
zipWithIndex(Iterable<T> iterable)

public static <T, R extends Collection<Pair<T, Integer>>> R
zipWithIndex(Iterable<T> iterable, R target)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait