T - type of the object.public abstract class Generator<T>
extends java.lang.Object
implements java.lang.Iterable<T>
| Constructor and Description |
|---|
Generator() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Iterator<T> |
iterator() |
protected abstract void |
run() |
void |
yield(T element)
Makes available the next item.
|
public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>protected abstract void run()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void yield(T element) throws java.lang.InterruptedException
element - the next itemjava.lang.InterruptedException - if await fails