Class IteratorIterate
java.lang.Object
org.eclipse.collections.impl.utility.internal.IteratorIterate
The IteratorIterate class implementations of the various iteration patterns for use with java.util.Iterator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Iterator<T> advanceIteratorTo(Iterator<T> iterator, int from) static <T,K, V> MutableMap <K, V> aggregateBy(Iterator<T> iterator, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator) static <T,K, V> MutableMap <K, V> aggregateBy(Iterator<T> iterator, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator) static <T> booleanallSatisfy(Iterator<T> iterator, Predicate<? super T> predicate) static <T,P> boolean allSatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T> booleananySatisfy(Iterator<T> iterator, Predicate<? super T> predicate) static <T,P> boolean anySatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T> RichIterable<RichIterable<T>> static <T, V, R extends Collection<V>>
Rstatic <T> MutableBooleanCollectioncollectBoolean(Iterator<T> iterator, BooleanFunction<? super T> booleanFunction) static <T, R extends MutableBooleanCollection>
RcollectBoolean(Iterator<T> iterator, BooleanFunction<? super T> booleanFunction, R target) static <T> MutableByteCollectioncollectByte(Iterator<T> iterator, ByteFunction<? super T> byteFunction) static <T, R extends MutableByteCollection>
RcollectByte(Iterator<T> iterator, ByteFunction<? super T> byteFunction, R target) static <T> MutableCharCollectioncollectChar(Iterator<T> iterator, CharFunction<? super T> charFunction) static <T, R extends MutableCharCollection>
RcollectChar(Iterator<T> iterator, CharFunction<? super T> charFunction, R target) static <T> MutableDoubleCollectioncollectDouble(Iterator<T> iterator, DoubleFunction<? super T> doubleFunction) static <T, R extends MutableDoubleCollection>
RcollectDouble(Iterator<T> iterator, DoubleFunction<? super T> doubleFunction, R target) static <T> MutableFloatCollectioncollectFloat(Iterator<T> iterator, FloatFunction<? super T> floatFunction) static <T, R extends MutableFloatCollection>
RcollectFloat(Iterator<T> iterator, FloatFunction<? super T> floatFunction, R target) static <T, V, R extends Collection<V>>
RcollectIf(Iterator<T> iterator, Predicate<? super T> predicate, Function<? super T, ? extends V> function, R targetCollection) static <T> MutableIntCollectioncollectInt(Iterator<T> iterator, IntFunction<? super T> intFunction) static <T, R extends MutableIntCollection>
RcollectInt(Iterator<T> iterator, IntFunction<? super T> intFunction, R target) static <T> MutableLongCollectioncollectLong(Iterator<T> iterator, LongFunction<? super T> longFunction) static <T, R extends MutableLongCollection>
RcollectLong(Iterator<T> iterator, LongFunction<? super T> longFunction, R target) static <T> MutableShortCollectioncollectShort(Iterator<T> iterator, ShortFunction<? super T> shortFunction) static <T, R extends MutableShortCollection>
RcollectShort(Iterator<T> iterator, ShortFunction<? super T> shortFunction, R target) static <T, P, A, R extends Collection<A>>
RcollectWith(Iterator<T> iterator, Function2<? super T, ? super P, ? extends A> function, P parameter, R targetCollection) static <T> intstatic <T,P> int countWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T> Tstatic <T> intdetectIndex(Iterator<T> iterator, Predicate<? super T> predicate) static <T,IV> int detectIndexWith(Iterator<T> iterator, Predicate2<? super T, ? super IV> predicate, IV injectedValue) static <T> Optional<T> detectOptional(Iterator<T> iterator, Predicate<? super T> predicate) static <T,P> T detectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T,P> Optional <T> detectWithOptional(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T> MutableList<T> static <T> MutableList<T> distinct(Iterator<T> iterator, HashingStrategy<? super T> hashingStrategy) static <T, R extends List<T>>
RDeprecated.in 7.0.static <T, R extends MutableCollection<T>>
Rstatic <T, V, R extends Collection<V>>
RflatCollect(Iterator<T> iterator, Function<? super T, ? extends Iterable<V>> function, R targetCollection) static <T> voidstatic <T,P> void forEachWith(Iterator<T> iterator, Procedure2<? super T, ? super P> procedure, P parameter) static <T> voidforEachWithIndex(Iterator<T> iterator, ObjectIntProcedure<? super T> objectIntProcedure) static <T,V> ImmutableMultimap <V, T> static <T, V, R extends MutableMultimap<V,T>>
Rstatic <T, V, R extends MutableMultimap<V,T>>
RgroupByEach(Iterator<T> iterator, Function<? super T, ? extends Iterable<V>> function, R target) static <K, T, R extends MutableMapIterable<K,T>>
RgroupByUniqueKey(Iterator<T> iterator, Function<? super T, ? extends K> function, R target) static <T> doubleinjectInto(double injectValue, Iterator<T> iterator, DoubleObjectToDoubleFunction<? super T> function) static <T> floatinjectInto(float injectValue, Iterator<T> iterator, FloatObjectToFloatFunction<? super T> function) static <T> intinjectInto(int injectValue, Iterator<T> iterator, IntObjectToIntFunction<? super T> function) static <T> longinjectInto(long injectValue, Iterator<T> iterator, LongObjectToLongFunction<? super T> function) static <T,IV> IV injectInto(IV injectValue, Iterator<T> iterator, Function2<? super IV, ? super T, ? extends IV> function) static <T,IV, P> IV injectIntoWith(IV injectValue, Iterator<T> iterator, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter) static <T> Tmax(Iterator<T> iterator, Comparator<? super T> comparator) static <T, V extends Comparable<? super V>>
Tstatic <T> Tmin(Iterator<T> iterator, Comparator<? super T> comparator) static <T, V extends Comparable<? super V>>
Tstatic <T> booleannoneSatisfy(Iterator<T> iterator, Predicate<? super T> predicate) static <T,P> boolean noneSatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T> PartitionMutableList<T> static <T, R extends PartitionMutableCollection<T>>
RpartitionWhile(Iterator<T> iterator, Predicate<? super T> predicate, R target) static <T,P> PartitionMutableList <T> partitionWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T, R extends Collection<T>>
Rstatic <T, P, R extends Collection<T>>
RrejectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection) static <T> booleanstatic <T> booleanstatic <T,P> boolean removeIfWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T,P> boolean removeIfWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter, Procedure<? super T> procedure) static <T, R extends Collection<T>>
Rstatic <T,P> Twin <MutableList<T>> selectAndRejectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) static <T, R extends Collection<T>>
RselectInstancesOf(Iterator<?> iterator, Class<T> clazz, R targetCollection) static <T, P, R extends Collection<T>>
RselectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P injectedValue, R targetCollection) static <T> booleanshortCircuit(Iterator<T> iterator, Predicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd) static <T,P> boolean shortCircuitWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate2, P parameter, boolean expected, boolean onShortCircuit, boolean atEnd) static <V,T> MutableMap <V, BigDecimal> sumByBigDecimal(Iterator<T> iterator, Function<? super T, ? extends V> groupBy, Function<? super T, BigDecimal> function) static <V,T> MutableMap <V, BigInteger> sumByBigInteger(Iterator<T> iterator, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function) static <T> BigDecimalsumOfBigDecimal(Iterator<T> iterator, Function<? super T, BigDecimal> function) static <T> BigIntegersumOfBigInteger(Iterator<T> iterator, Function<? super T, BigInteger> function) static <T> doublesumOfDouble(Iterator<T> iterator, DoubleFunction<? super T> function) static <T> doublesumOfFloat(Iterator<T> iterator, FloatFunction<? super T> function) static <T> longsumOfInt(Iterator<T> iterator, IntFunction<? super T> function) static <T> longsumOfLong(Iterator<T> iterator, LongFunction<? super T> function) static <T, R extends MutableCollection<T>>
Rstatic <X, Y, R extends Collection<Pair<X,Y>>>
Rstatic <T, R extends Collection<Pair<T,Integer>>>
RzipWithIndex(Iterator<T> iterator, R target)
-
Constructor Details
-
IteratorIterate
private IteratorIterate()
-
-
Method Details
-
selectAndRejectWith
public static <T,P> Twin<MutableList<T>> selectAndRejectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
partition
public static <T> PartitionMutableList<T> partition(Iterator<T> iterator, Predicate<? super T> predicate) - See Also:
-
partitionWith
public static <T,P> PartitionMutableList<T> partitionWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - Since:
- 5.0
- See Also:
-
partitionWhile
public static <T, R extends PartitionMutableCollection<T>> R partitionWhile(Iterator<T> iterator, Predicate<? super T> predicate, R target) -
takeWhile
public static <T, R extends MutableCollection<T>> R takeWhile(Iterator<T> iterator, Predicate<? super T> predicate, R target) -
dropWhile
public static <T, R extends MutableCollection<T>> R dropWhile(Iterator<T> iterator, Predicate<? super T> predicate, R target) -
count
-
countWith
public static <T,P> int countWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
select
public static <T, R extends Collection<T>> R select(Iterator<T> iterator, Predicate<? super T> predicate, R targetCollection) - See Also:
-
selectWith
public static <T, P, R extends Collection<T>> R selectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P injectedValue, R targetCollection) - See Also:
-
selectInstancesOf
public static <T, R extends Collection<T>> R selectInstancesOf(Iterator<?> iterator, Class<T> clazz, R targetCollection) - See Also:
-
collectIf
public static <T, V, R extends Collection<V>> R collectIf(Iterator<T> iterator, Predicate<? super T> predicate, Function<? super T, ? extends V> function, R targetCollection) - See Also:
-
reject
public static <T, R extends Collection<T>> R reject(Iterator<T> iterator, Predicate<? super T> predicate, R targetCollection) - See Also:
-
rejectWith
public static <T, P, R extends Collection<T>> R rejectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection) - See Also:
-
collect
public static <T, V, R extends Collection<V>> R collect(Iterator<T> iterator, Function<? super T, ? extends V> function, R targetCollection) - See Also:
-
collectBoolean
public static <T> MutableBooleanCollection collectBoolean(Iterator<T> iterator, BooleanFunction<? super T> booleanFunction) - See Also:
-
collectBoolean
public static <T, R extends MutableBooleanCollection> R collectBoolean(Iterator<T> iterator, BooleanFunction<? super T> booleanFunction, R target) - See Also:
-
collectByte
public static <T> MutableByteCollection collectByte(Iterator<T> iterator, ByteFunction<? super T> byteFunction) - See Also:
-
collectByte
public static <T, R extends MutableByteCollection> R collectByte(Iterator<T> iterator, ByteFunction<? super T> byteFunction, R target) - See Also:
-
collectChar
public static <T> MutableCharCollection collectChar(Iterator<T> iterator, CharFunction<? super T> charFunction) - See Also:
-
collectChar
public static <T, R extends MutableCharCollection> R collectChar(Iterator<T> iterator, CharFunction<? super T> charFunction, R target) - See Also:
-
collectDouble
public static <T> MutableDoubleCollection collectDouble(Iterator<T> iterator, DoubleFunction<? super T> doubleFunction) - See Also:
-
collectDouble
public static <T, R extends MutableDoubleCollection> R collectDouble(Iterator<T> iterator, DoubleFunction<? super T> doubleFunction, R target) - See Also:
-
collectFloat
public static <T> MutableFloatCollection collectFloat(Iterator<T> iterator, FloatFunction<? super T> floatFunction) - See Also:
-
collectFloat
public static <T, R extends MutableFloatCollection> R collectFloat(Iterator<T> iterator, FloatFunction<? super T> floatFunction, R target) - See Also:
-
collectInt
public static <T> MutableIntCollection collectInt(Iterator<T> iterator, IntFunction<? super T> intFunction) - See Also:
-
collectInt
public static <T, R extends MutableIntCollection> R collectInt(Iterator<T> iterator, IntFunction<? super T> intFunction, R target) - See Also:
-
collectLong
public static <T> MutableLongCollection collectLong(Iterator<T> iterator, LongFunction<? super T> longFunction) - See Also:
-
collectLong
public static <T, R extends MutableLongCollection> R collectLong(Iterator<T> iterator, LongFunction<? super T> longFunction, R target) - See Also:
-
collectShort
public static <T> MutableShortCollection collectShort(Iterator<T> iterator, ShortFunction<? super T> shortFunction) - See Also:
-
collectShort
public static <T, R extends MutableShortCollection> R collectShort(Iterator<T> iterator, ShortFunction<? super T> shortFunction, R target) - See Also:
-
flatCollect
public static <T, V, R extends Collection<V>> R flatCollect(Iterator<T> iterator, Function<? super T, ? extends Iterable<V>> function, R targetCollection) - See Also:
-
forEach
-
forEachWithIndex
public static <T> void forEachWithIndex(Iterator<T> iterator, ObjectIntProcedure<? super T> objectIntProcedure) - See Also:
-
detect
-
detectWith
public static <T,P> T detectWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
detectOptional
-
detectWithOptional
public static <T,P> Optional<T> detectWithOptional(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
injectInto
-
injectInto
public static <T> int injectInto(int injectValue, Iterator<T> iterator, IntObjectToIntFunction<? super T> function) - See Also:
-
injectInto
public static <T> long injectInto(long injectValue, Iterator<T> iterator, LongObjectToLongFunction<? super T> function) - See Also:
-
injectInto
public static <T> double injectInto(double injectValue, Iterator<T> iterator, DoubleObjectToDoubleFunction<? super T> function) - See Also:
-
injectInto
public static <T> float injectInto(float injectValue, Iterator<T> iterator, FloatObjectToFloatFunction<? super T> function) - See Also:
-
injectIntoWith
-
shortCircuit
-
shortCircuitWith
public static <T,P> boolean shortCircuitWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate2, P parameter, boolean expected, boolean onShortCircuit, boolean atEnd) -
anySatisfy
-
anySatisfyWith
public static <T,P> boolean anySatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
allSatisfy
-
allSatisfyWith
public static <T,P> boolean allSatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
noneSatisfy
-
noneSatisfyWith
public static <T,P> boolean noneSatisfyWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
removeIf
-
removeIfWith
public static <T,P> boolean removeIfWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter) - See Also:
-
removeIf
-
removeIfWith
public static <T,P> boolean removeIfWith(Iterator<T> iterator, Predicate2<? super T, ? super P> predicate, P parameter, Procedure<? super T> procedure) -
detectIndex
-
detectIndexWith
public static <T,IV> int detectIndexWith(Iterator<T> iterator, Predicate2<? super T, ? super IV> predicate, IV injectedValue) - See Also:
-
forEachWith
public static <T,P> void forEachWith(Iterator<T> iterator, Procedure2<? super T, ? super P> procedure, P parameter) - See Also:
-
collectWith
public static <T, P, A, R extends Collection<A>> R collectWith(Iterator<T> iterator, Function2<? super T, ? super P, ? extends A> function, P parameter, R targetCollection) - See Also:
-
groupBy
public static <T,V> ImmutableMultimap<V,T> groupBy(Iterator<T> iterator, Function<? super T, ? extends V> function) - See Also:
-
groupBy
public static <T, V, R extends MutableMultimap<V,T>> R groupBy(Iterator<T> iterator, Function<? super T, ? extends V> function, R target) - See Also:
-
groupByEach
public static <T, V, R extends MutableMultimap<V,T>> R groupByEach(Iterator<T> iterator, Function<? super T, ? extends Iterable<V>> function, R target) - See Also:
-
groupByUniqueKey
public static <K, T, R extends MutableMapIterable<K,T>> R groupByUniqueKey(Iterator<T> iterator, Function<? super T, ? extends K> function, R target) - See Also:
-
distinct
@Deprecated public static <T, R extends List<T>> R distinct(Iterator<T> iterator, R targetCollection) Deprecated.in 7.0. -
distinct
- Since:
- 7.0.
-
distinct
public static <T> MutableList<T> distinct(Iterator<T> iterator, HashingStrategy<? super T> hashingStrategy) - Since:
- 7.0.
-
zip
public static <X, Y, R extends Collection<Pair<X,Y>>> R zip(Iterator<X> xs, Iterator<Y> ys, R target) - See Also:
-
zipWithIndex
public static <T, R extends Collection<Pair<T,Integer>>> R zipWithIndex(Iterator<T> iterator, R target) - See Also:
-
chunk
- See Also:
-
min
- See Also:
-
max
- See Also:
-
advanceIteratorTo
-
sumOfInt
-
sumOfLong
-
sumOfFloat
-
sumOfDouble
-
sumOfBigDecimal
public static <T> BigDecimal sumOfBigDecimal(Iterator<T> iterator, Function<? super T, BigDecimal> function) -
sumOfBigInteger
public static <T> BigInteger sumOfBigInteger(Iterator<T> iterator, Function<? super T, BigInteger> function) -
sumByBigDecimal
public static <V,T> MutableMap<V, BigDecimal> sumByBigDecimal(Iterator<T> iterator, Function<? super T, ? extends V> groupBy, Function<? super T, BigDecimal> function) -
sumByBigInteger
public static <V,T> MutableMap<V, BigInteger> sumByBigInteger(Iterator<T> iterator, Function<? super T, ? extends V> groupBy, Function<? super T, BigInteger> function) -
aggregateBy
public static <T,K, MutableMap<K,V> V> aggregateBy(Iterator<T> iterator, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator) -
aggregateBy
public static <T,K, MutableMap<K,V> V> aggregateBy(Iterator<T> iterator, Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator) -
minBy
public static <T, V extends Comparable<? super V>> T minBy(Iterator<T> iterator, Function<? super T, ? extends V> function) -
maxBy
public static <T, V extends Comparable<? super V>> T maxBy(Iterator<T> iterator, Function<? super T, ? extends V> function)
-