ist.palcom.base
Class Coroutine

java.lang.Object
  extended by ist.palcom.base.Object
      extended by ist.palcom.base.Coroutine
Direct Known Subclasses:
Thread

public class Coroutine
extends Object

Instances of Coroutine represents independent execution sequences. A coroutine has its own stack.


Constructor Summary
Coroutine()
          Creates a new coroutine.
 
Method Summary
 void attach()
          Attaches this Coroutine.
 void attachInterruptable()
          Attaches this coroutine while interrupts are enabled.
 void run()
          The run method does nothing.
 void suspend()
          Suspends this Coroutine and returns control to the attach point.
 void terminate()
          Terminates this Coroutine and returns control the attach point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coroutine

public Coroutine()
Creates a new coroutine.

Method Detail

attach

public void attach()
Attaches this Coroutine. If this is the first attach, the run method will be executed, otherwise it will be resumed.


run

public void run()
The run method does nothing. The run method is executed as result of attaching this Coroutine.


suspend

public void suspend()
Suspends this Coroutine and returns control to the attach point.


terminate

public void terminate()
Terminates this Coroutine and returns control the attach point.


attachInterruptable

public void attachInterruptable()
Attaches this coroutine while interrupts are enabled.