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

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)
              throws StreamSkipException,
                     StreamContingencyException
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
Throws:
StreamSkipException - if no element should be yielded from the input element
StreamContingencyException - if no element can be yielded, because the input element violates pre-conditions

process

protected abstract void process(E element)
                         throws StreamSkipException,
                                StreamContingencyException
Processes an element of a Stream.

Parameters:
element - the input element
Throws:
StreamSkipException - if no element should be yielded from the input element
StreamContingencyException - if no element can be yielded, because the input element violates pre-conditions
RuntimeException - if no element can be yielded from the input element, becuase of an unrecoverable condition


Copyright © 2012. All Rights Reserved.