ref_send API 1.16
defensive programming in Java

org.waterken.serial
Interface Series<T>

All Superinterfaces:
java.lang.Iterable<Volatile<T>>

public interface Series<T>
extends java.lang.Iterable<Volatile<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
 Volatile<T> consume()
          Removes the first element in the series.
 void produce(Volatile<T> value)
          Appends a value to the end of the series.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

produce

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

Parameters:
value - value to append

consume

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

Returns:
value of the removed element

ref_send API 1.16
defensive programming in Java

Submit a bug or feature, or get help

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