Generator Class

A custom iterator that yields its values one at a time. This is a great alternative to arrays or lists when dealing with large data. By yielding one entry at a time, this iterator can help avoid out of memory exceptions. Subclasses must define a method called {@link #run()} and may call {@link yield(T)} to return values one at a time. Example:

    Generator<String> generator = new Generator<String>() {


public Generator( )


iterator( ) returns java.util.Iterator