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

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

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

convert a generator of T into a generator if Index to enumerate items.

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

Constructor Summary
EnumerateGenerator(Generator<T> source)
           
EnumerateGenerator(Generator<T> source, int startIndex)
           
 
Method Summary
 Index<T> next()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumerateGenerator

public EnumerateGenerator(Generator<T> source)

EnumerateGenerator

public EnumerateGenerator(Generator<T> source,
                          int startIndex)
Method Detail

next

public Index<T> next()
              throws java.util.NoSuchElementException
Specified by:
next in interface Generator<Index<T>>
Returns:
the next item in the sequence.
Throws:
java.util.NoSuchElementException - when sequence is exhausted.


Copyright © 2011. All Rights Reserved.