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

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

public class ChainGenerator<T>
extends java.lang.Object
implements Generator<T>

A generator that returns elements from the first generators until it is exhausted, then proceeds to the next generator, until all of the generators are exhausted.

Author:
eric
See Also:
ChainGenerator's wiki page, neoitertools site

Constructor Summary
ChainGenerator(Generator<Generator<T>> iterators)
          chain together a sequence of sequences.
 
Method Summary
 T next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainGenerator

public ChainGenerator(Generator<Generator<T>> iterators)
chain together a sequence of sequences.

Parameters:
iterators -
Method Detail

next

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


Copyright © 2011. All Rights Reserved.