ref_send API 2.17
defensive programming in Java

org.waterken.serial
Interface Series<T>

Type Parameters:
T - value type
All Superinterfaces:
java.lang.Iterable<Promise<T>>

public interface Series<T>
extends java.lang.Iterable<Promise<T>>

An infinite series of elements.

A series is a FIFO list of values where the values can be removed from the list before they have been added. An invocation of consume() returns a promise for what will be the next element in the list, once it is added, at which time it will already have been removed. ;)


Method Summary
 Promise<T> consume()
          Removes the first element in the series.
 Element<T> getFront()
          Gets the front element.
 void produce(Promise<T> value)
          Appends a value to the end of the series.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getFront

Element<T> getFront()
Gets the front element.


produce

void produce(Promise<T> value)
Appends a value to the end of the series.

Parameters:
value - value to append

consume

Promise<T> consume()
Removes the first element in the series.

Returns:
value of the removed element

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.