|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.ens_cachan.dptinfo.util.Iterators
public class Iterators
A class for generic function calls on Iterable
structures.
Iterator
,
java.util.Iterable
Method Summary | ||
---|---|---|
static
|
filter(Function<? super A,java.lang.Boolean> f,
java.lang.Iterable<A> c)
Returns an Iterable structure that contains the
elements of c for which f returns
true . |
|
static
|
fold(Function<Pair<A,B>,A> f,
C a,
java.lang.Iterable<? extends B> c)
Iterates through a collection and reduces it using a binary operator from begin to end. |
|
static
|
map(Function<? super A,B> f,
java.lang.Iterable<A> c)
Returns an Iterable structure that contains the
result of f applied to each element in the iteration
of c . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <A,B> java.lang.Iterable<B> map(Function<? super A,B> f, java.lang.Iterable<A> c)
Iterable
structure that contains the
result of f
applied to each element in the iteration
of c
.
f
- a function to be applied to the elements of
c
.c
- an iterable collection of objects.
f(c)
.public static <A> java.lang.Iterable<A> filter(Function<? super A,java.lang.Boolean> f, java.lang.Iterable<A> c)
Iterable
structure that contains the
elements of c
for which f
returns
true
.
f
- a filter to be applied to the elements of
c
.c
- an iterable collection of objects.
e
of
c
that verify f(e) == true
.public static <A extends java.lang.Comparable<? super A>,B extends java.lang.Comparable<? super B>,C extends A> A fold(Function<Pair<A,B>,A> f, C a, java.lang.Iterable<? extends B> c)
f
- a binary operator.a
- an initial value.c
- a collection.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |