|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.clareo.coroutines.user.Coroutines
public final class Coroutines
This class contains methods used when creating coroutine
Constructor Summary | |
---|---|
Coroutines()
|
Method Summary | ||
---|---|---|
static
|
_()
Exit point of coroutine. |
|
static
|
yield()
Yield point of coroutine. |
|
static
|
yield(E e)
Yield point of coroutine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Coroutines()
Method Detail |
---|
public static <E,A> CoIterator<E,A> _()
return
statement is needed. This statement throws
NoSuchElementException
in runtime or
InvalidCoroutineException
if used in non-coroutine method
(it may be thrown if coroutine instrumentation fails)
E
- anythingA
- anything
return
statementspublic static <A> A yield()
A
- type of yield
's result
send
to resume
coroutine execution it becomes result of yield
public static <E,A> A yield(E e)
e
to caller
E
- type of yielded valueA
- type of yield
's resulte
- passed to caller
send
to resume
coroutine execution it becomes result of yield
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |