org.gcube.data.streams
Class StreamConsumer<T>

java.lang.Object
  extended by org.gcube.data.streams.StreamConsumer<T>
Type Parameters:
T - the type of stream elements

public final class StreamConsumer<T>
extends Object

A generic Stream consumer that delegates element processing and failure handling to a Callback.

Author:
Fabio Simeoni

Constructor Summary
StreamConsumer(Stream<T> stream, Callback<T> callback)
          Creates an instance with a Stream and a Callback
 
Method Summary
 void start()
          Starts the iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamConsumer

public StreamConsumer(Stream<T> stream,
                      Callback<T> callback)
Creates an instance with a Stream and a Callback

Parameters:
stream - the stream
callback - the callback
Method Detail

start

public void start()
Starts the iteration.



Copyright © 2012. All Rights Reserved.