net.ericaro.neoitertools.generators
Class ZipGenerator<T>

java.lang.Object
  extended by net.ericaro.neoitertools.generators.ZipGenerator<T>
All Implemented Interfaces:
Generator<java.util.List<T>>

public class ZipGenerator<T>
extends java.lang.Object
implements Generator<java.util.List<T>>

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:
ZipGenerator's wiki page, neoitertools site

Constructor Summary
ZipGenerator(java.util.List<Generator<T>> generators)
           
 
Method Summary
 java.util.List<T> next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipGenerator

public ZipGenerator(java.util.List<Generator<T>> generators)
Method Detail

next

public java.util.List<T> next()
Specified by:
next in interface Generator<java.util.List<T>>
Returns:
the next item in the sequence.


Copyright © 2011. All Rights Reserved.