pl.clareo.coroutines.user
Class StaticPattern<E,A>

java.lang.Object
  extended by pl.clareo.coroutines.user.StaticPattern<E,A>
All Implemented Interfaces:
Controler<E,A>

public class StaticPattern<E,A>
extends java.lang.Object
implements Controler<E,A>


Constructor Summary
StaticPattern(A[] toSend)
           
StaticPattern(A initial, A[] toSend)
           
 
Method Summary
 void closed()
          Called when coroutine has been closed
 A init()
          Generate value sent to coroutine on the first yield
 void noNextElement()
          Called when coroutine has been closed because it was unable to generate more results
 A respondTo(E produced)
          Generates the next value sent to coroutine after some yield has generated produced
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticPattern

public StaticPattern(A initial,
                     A[] toSend)

StaticPattern

public StaticPattern(A[] toSend)
Method Detail

closed

public void closed()
Description copied from interface: Controler
Called when coroutine has been closed

Specified by:
closed in interface Controler<E,A>

init

public A init()
Description copied from interface: Controler
Generate value sent to coroutine on the first yield

Specified by:
init in interface Controler<E,A>
Returns:
value to be sent to coroutine

noNextElement

public void noNextElement()
Description copied from interface: Controler
Called when coroutine has been closed because it was unable to generate more results

Specified by:
noNextElement in interface Controler<E,A>

respondTo

public A respondTo(E produced)
            throws java.lang.IllegalStateException
Description copied from interface: Controler
Generates the next value sent to coroutine after some yield has generated produced

Specified by:
respondTo in interface Controler<E,A>
Parameters:
produced - last yielded value
Returns:
value to be sent to coroutine
Throws:
java.lang.IllegalStateException - Controler may throw this exception to forcibly close underlying coroutine


Copyright © 2010 CLAREO. All Rights Reserved.