net.ericaro.neoitertools.generators
Class ZipPairGenerator<T1,T2>
java.lang.Object
net.ericaro.neoitertools.generators.ZipPairGenerator<T1,T2>
- All Implemented Interfaces:
- Generator<Pair<T1,T2>>
public class ZipPairGenerator<T1,T2>
- extends java.lang.Object
- implements Generator<Pair<T1,T2>>
an Generator of Pairs, where the i-th couple contains the i-th
element from each of the argument Generator. The returned Generator is
truncated in length to the length of the shortest argument sequence.
Due to static typing of java, it is not possible to provide a generic length
of Generator and at the same time provide mixed-type tuples.
- Author:
- eric
- See Also:
- ZipPairGenerator's wiki page,
neoitertools site
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipPairGenerator
public ZipPairGenerator(Generator<T1> iterator1,
Generator<T2> iterator2)
next
public Pair<T1,T2> next()
- Specified by:
next in interface Generator<Pair<T1,T2>>
- Returns:
- the next item in the sequence.
Copyright © 2011. All Rights Reserved.