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

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

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

Make a Generator returning elements from the Generator and saving a copy of each. When the Generator is exhausted, return elements from the saved copy. Repeats indefinitely.

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

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

Constructor Detail

CycleGenerator

public CycleGenerator(Generator<T> generator)
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.