|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.infomancers.collections.yield.Yielder<T>
public abstract class Yielder<T>
Abstract class from which all yielders extend.
When a sub-class implements the yieldNextCore method, during runtime it will be enhanced to the following: 1. All local variables within the yieldNextCore method will be promoted to class member fields. 2. A new member, "state" of type byte, will be added. 3. Each call to yieldReturn will have the following code appended to after it:
state = [number];
return;
Label[number]:
4. Each call to yieldBreak will have a return
statement appended to it.
5. At the beginning of the method, a switch will be added
containing a number of case branches equal to the number
of yieldReturn calls, such as the following code:
switch (state) {
case [number]: goto Label[number];
..
}
| Constructor Summary | |
|---|---|
Yielder()
|
|
| Method Summary | |
|---|---|
java.util.Iterator<T> |
iterator()
Returns an iterator which goes through all elements returned using the yieldReturn
method during a yieldNextCore implementation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Yielder()
| Method Detail |
|---|
public java.util.Iterator<T> iterator()
yieldReturn
method during a yieldNextCore implementation.
iterator in interface java.lang.Iterable<T>
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||