/** @see Iterate#tranformIf(Iterable, Predicate, Function, Collection) */ public static <T, V, R extends Collection<V>> R tranformIf( Iterable<T> iterable, Predicate<? super T> predicate, Function<? super T, ? extends V> function, R targetCollection) { return IteratorIterate.transformIf(iterable.iterator(), predicate, function, targetCollection); }
/** @see Iterate#foldLeftWith(Object, Iterable, Function3, Object) */ public static <T, IV, P> IV foldLeftWith( IV injectValue, Iterable<T> iterable, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter) { return IteratorIterate.foldLeftWith(injectValue, iterable.iterator(), function, parameter); }
/** @see Iterate#filterNotWith(Iterable, Predicate2, Object, Collection) */ public static <T, P, R extends Collection<T>> R filterNotWith( Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter, R targetCollection) { return IteratorIterate.filterNotWith( iterable.iterator(), predicate, parameter, targetCollection); }
/** @see Iterate#transformWith(Iterable, Function2, Object, Collection) */ public static <T, P, A, R extends Collection<A>> R transformWith( Iterable<T> iterable, Function2<? super T, ? super P, ? extends A> function, P parameter, R targetCollection) { return IteratorIterate.transformWith( iterable.iterator(), function, parameter, targetCollection); }
/** @see Iterate#filterWith(Iterable, Predicate2, Object, Collection) */ public static <T, P, R extends Collection<T>> R filterWith( Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P injectedValue, R targetCollection) { return IteratorIterate.filterWith( iterable.iterator(), predicate, injectedValue, targetCollection); }
public static <T> void forEachWithIndex( List<T> iterable, int from, int to, ObjectIntProcedure<? super T> objectIntProcedure) { if (from < 0 || to < 0) { throw new IllegalArgumentException("Neither from nor to may be negative."); } Iterator<T> iterator = IteratorIterate.advanceIteratorTo(iterable.iterator(), from); int i = from; while (iterator.hasNext() && i <= to) { objectIntProcedure.value(iterator.next(), i++); } }
/** @see Iterate#zipWithIndex(Iterable, Collection) */ public static <T, R extends Collection<Pair<T, Integer>>> R zipWithIndex( Iterable<T> iterable, R target) { return IteratorIterate.zipWithIndex(iterable.iterator(), target); }
/** @see Iterate#groupByEach(Iterable, Function, MutableMultimap) */ public static <T, V, R extends MutableMultimap<V, T>> R groupByEach( Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function, R target) { return IteratorIterate.groupByEach(iterable.iterator(), function, target); }
/** @see Iterate#zip(Iterable, Iterable, Collection) */ public static <X, Y, R extends Collection<Pair<X, Y>>> R zip( Iterable<X> xs, Iterable<Y> ys, R target) { return IteratorIterate.zip(xs.iterator(), ys.iterator(), target); }
/** @see Iterate#forEachWith(Iterable, Procedure2, Object) */ public static <T, P> void forEachWith( Iterable<T> iterable, Procedure2<? super T, ? super P> procedure, P parameter) { IteratorIterate.forEachWith(iterable.iterator(), procedure, parameter); }
/** @see Iterate#filterNot(Iterable, Predicate, Collection) */ public static <T, R extends Collection<T>> R filterNot( Iterable<T> iterable, Predicate<? super T> predicate, R targetCollection) { return IteratorIterate.filterNot(iterable.iterator(), predicate, targetCollection); }
/** @see Iterate#max(Iterable) */ public static <T> T max(Iterable<T> iterable) { return IteratorIterate.max(iterable.iterator(), Comparators.naturalOrder()); }
/** @see Iterate#foldLeft(Object, Iterable, Function2) */ public static <T, IV> IV foldLeft( IV injectValue, Iterable<T> iterable, Function2<? super IV, ? super T, ? extends IV> function) { return IteratorIterate.foldLeft(injectValue, iterable.iterator(), function); }
/** @see Iterate#partitionWith(Iterable, Predicate2, Object) */ public static <T, IV> Twin<MutableList<T>> partitionWith( Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue) { return IteratorIterate.partitionWith(iterable.iterator(), predicate, injectedValue); }
/** @see Iterate#count(Iterable, Predicate) */ public static <T> int count(Iterable<T> iterable, Predicate<? super T> predicate) { return IteratorIterate.count(iterable.iterator(), predicate); }
/** @see Iterate#forEach(Iterable, Procedure) */ public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure) { IteratorIterate.forEach(iterable.iterator(), procedure); }
/** @see Iterate#allSatisfy(Iterable, Predicate) */ public static <T> boolean allSatisfy(Iterable<T> iterable, Predicate<? super T> predicate) { return IteratorIterate.allSatisfy(iterable.iterator(), predicate); }
/** @see Iterate#foldLeft(double, Iterable, DoubleObjectToDoubleFunction) */ public static <T> double foldLeft( double injectValue, Iterable<T> iterable, DoubleObjectToDoubleFunction<? super T> function) { return IteratorIterate.foldLeft(injectValue, iterable.iterator(), function); }
/** @see Iterate#foldLeft(long, Iterable, LongObjectToLongFunction) */ public static <T> long foldLeft( long injectValue, Iterable<T> iterable, LongObjectToLongFunction<? super T> function) { return IteratorIterate.foldLeft(injectValue, iterable.iterator(), function); }
/** @see Iterate#foldLeft(int, Iterable, IntObjectToIntFunction) */ public static <T> int foldLeft( int injectValue, Iterable<T> iterable, IntObjectToIntFunction<? super T> function) { return IteratorIterate.foldLeft(injectValue, iterable.iterator(), function); }
/** @see Iterate#chunk(Iterable, int) */ public static <T> RichIterable<RichIterable<T>> chunk(Iterable<T> iterable, int size) { return IteratorIterate.chunk(iterable.iterator(), size); }
/** @see Iterate#flatTransform(Iterable, Function, Collection) */ public static <T, V, R extends Collection<V>> R flatTransform( Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function, R targetCollection) { return IteratorIterate.flatTransform(iterable.iterator(), function, targetCollection); }
/** @see Iterate#max(Iterable, Comparator) */ public static <T> T max(Iterable<T> iterable, Comparator<? super T> comparator) { return IteratorIterate.max(iterable.iterator(), comparator); }
/** @see Iterate#findIndex(Iterable, Predicate) */ public static <T> int findIndex(Iterable<T> iterable, Predicate<? super T> predicate) { return IteratorIterate.findIndex(iterable.iterator(), predicate); }
/** @see Iterate#allSatisfyWith(Iterable, Predicate2, Object) */ public static <T, IV> boolean allSatisfyWith( Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue) { return IteratorIterate.allSatisfyWith(iterable.iterator(), predicate, injectedValue); }
/** @see Iterate#forEachWithIndex(Iterable, ObjectIntProcedure) */ public static <T> void forEachWithIndex( Iterable<T> iterable, ObjectIntProcedure<? super T> objectIntProcedure) { IteratorIterate.forEachWithIndex(iterable.iterator(), objectIntProcedure); }
/** @see Iterate#partition(Iterable, Predicate) */ public static <T> PartitionMutableList<T> partition( Iterable<T> iterable, Predicate<? super T> predicate) { return IteratorIterate.partition(iterable.iterator(), predicate); }
/** @see Iterate#removeIfWith(Iterable, Predicate2, Object) */ public static <T, P> Iterable<T> removeIfWith( Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter) { IteratorIterate.removeIfWith(iterable.iterator(), predicate, parameter); return iterable; }
/** @see Iterate#countWith(Iterable, Predicate2, Object) */ public static <T, IV> int countWith( Iterable<T> iterable, Predicate2<? super T, ? super IV> predicate, IV injectedValue) { return IteratorIterate.countWith(iterable.iterator(), predicate, injectedValue); }
public static <T> Iterable<T> removeIf( Iterable<T> iterable, Predicate<? super T> predicate, Procedure<? super T> procedure) { IteratorIterate.removeIf(iterable.iterator(), predicate, procedure); return iterable; }