ru.yandex.bolts.collection
Interface IterableF<E>

All Superinterfaces:
Iterable<E>
All Known Subinterfaces:
CollectionF<E>, ListF<E>, SetF<E>
All Known Implementing Classes:
AbstractCollectionF, AbstractListF, AbstractSetF, ArrayListBase, ArrayListF, DefaultCollectionF, DefaultListF, DefaultSetF, EmptyList, EmptySet, ListMap, ListOf2, Option, Option.None, Option.Some, ReadOnlyArrayList, SetFromMap, SingletonList, SingletonSet, UnmodifiableDefaultCollectionF, UnmodifiableDefaultListF, UnmodifiableDefaultSetF

public interface IterableF<E>
extends Iterable<E>

Extended iterable.

Author:
Stepan Koltsov

Method Summary
 boolean exists(Function1B<? super E> p)
          Return true iff element matching predicate exists
 Option<E> find(Function1B<? super E> p)
          Find element matching predicate
<B> B
foldLeft(B z, Function2<B,E,B> f)
          Fold left.
<B> B
foldRight(B z, Function2<E,B,B> f)
          Fold right.
 boolean forAll(Function1B<? super E> p)
          Return true iff predicate matches all elements
 void forEach(Function1V<? super E> f)
          Execute function for each element
 IteratorF<E> iterator()
          Elements as iterator
 String mkString(String sep)
          Make string by joining elements with given separator
 String mkString(String start, String sep, String end)
          Make string
 E reduceLeft(Function2<E,E,E> f)
          Reduce left.
 E reduceRight(Function2<E,E,E> f)
          Reduce right.
<F> IterableF<F>
uncheckedCast()
           
 

Method Detail

iterator

IteratorF<E> iterator()
Elements as iterator

Specified by:
iterator in interface Iterable<E>

forEach

void forEach(Function1V<? super E> f)
Execute function for each element


forAll

boolean forAll(Function1B<? super E> p)
Return true iff predicate matches all elements


exists

boolean exists(Function1B<? super E> p)
Return true iff element matching predicate exists


find

Option<E> find(Function1B<? super E> p)
Find element matching predicate


foldLeft

<B> B foldLeft(B z,
               Function2<B,E,B> f)
Fold left. Compute f(f(...f(f(z, e_1), e_2) ..., e_n-1), e_n)


foldRight

<B> B foldRight(B z,
                Function2<E,B,B> f)
Fold right. Compute f(e_1, f(e_2, ... f(e_n-1, f(e_n, z)) ...))


reduceLeft

E reduceLeft(Function2<E,E,E> f)
Reduce left. Compute f(f(...f(f(f(e_1, e_2), e_3), e_4) ..., e_n-1), e_n)


reduceRight

E reduceRight(Function2<E,E,E> f)
Reduce right. Compute f(e_1, f(e_2, ... f(e_n-2, f(e_n-1, e_n)) ...))


mkString

String mkString(String sep)
Make string by joining elements with given separator


mkString

String mkString(String start,
                String sep,
                String end)
Make string


uncheckedCast

<F> IterableF<F> uncheckedCast()