org.gcube.data.streams.generators
Interface Generator<E1,E2>

Type Parameters:
E1 - the type of elements in the input stream
E2 - the type of elements in the output stream
All Known Implementing Classes:
Filter, LoggingListener, NoOpGenerator, Processor

public interface Generator<E1,E2>

Yields elements of a Stream from elements of another Stream.

Author:
Fabio Simeoni
See Also:
Stream

Field Summary
static Iteration iteration
          The ongoing iteration.
 
Method Summary
 E2 yield(E1 element)
          Yields an element of a Stream from an element of another Stream.
 

Field Detail

iteration

static final Iteration iteration
The ongoing iteration.

Method Detail

yield

E2 yield(E1 element)
         throws StreamSkipSignal,
                StreamStopSignal
Yields an element of a Stream from an element of another Stream.

Parameters:
element - the input element
Returns:
the output element
Throws:
StreamSkipSignal - if no element should be yielded from the input element (i.e. the element should not contribute to the output stream)
StreamStopSignal - if no further element should be yielded
RuntimeException - if no element can be yielded from the input element


Copyright © 2012. All Rights Reserved.