org.gcube.data.streams.generators
Class Processor<E>

java.lang.Object
  extended by org.gcube.data.streams.generators.Filter<E,E>
      extended by org.gcube.data.streams.generators.Processor<E>
Type Parameters:
E - the type of input elements
All Implemented Interfaces:
Generator<E,E>

public abstract class Processor<E>
extends Filter<E,E>

A Filter that changes the elements of the input Stream.

Author:
Fabio Simeoni

Field Summary
 
Fields inherited from interface org.gcube.data.streams.generators.Generator
iteration
 
Constructor Summary
Processor()
           
 
Method Summary
protected abstract  void process(E element)
          Processes an element of a Stream.
 E yield(E element)
          Yields an element of a Stream from an element of another Stream.
 
Methods inherited from class org.gcube.data.streams.generators.Filter
skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Processor

public Processor()
Method Detail

yield

public final E yield(E element)
Description copied from interface: Generator
Yields an element of a Stream from an element of another Stream.

Parameters:
element - the input element
Returns:
the output element

process

protected abstract void process(E element)
Processes an element of a Stream.

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


Copyright © 2012. All Rights Reserved.