A
- The multiplicand Iterable element typeB
- The multiplier Iterable element typepublic final class CartesianProduct<A,B> extends Object implements Fn2<Iterable<A>,Iterable<B>,Iterable<Tuple2<A,B>>>
Iterable<A>
and Iterable<B>
,
returning an Iterable<Tuple2<A, B>>
, the products as tuples of
multiplicand A
s and multiplier B
s.
Note that this algorithm exhaustively pairs all elements from Iterable<B>
to the first element of
Iterable<A>
before advancing to the next element of Iterable<A>
, so if
Iterable<B>
is infinite, only one element from Iterable<A>
will ever be
paired.
Zip
Modifier and Type | Method and Description |
---|---|
static <A,B> CartesianProduct<A,B> |
cartesianProduct() |
static <A,B> Fn1<Iterable<B>,Iterable<Tuple2<A,B>>> |
cartesianProduct(Iterable<A> as) |
static <A,B> Iterable<Tuple2<A,B>> |
cartesianProduct(Iterable<A> as,
Iterable<B> bs) |
Iterable<Tuple2<A,B>> |
checkedApply(Iterable<A> as,
Iterable<B> bs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, flip, fn2, fromBiFunction, toBiFunction, uncurry, widen