org.gcube.data.streams.generators
Class LoggingListener<E>
java.lang.Object
org.gcube.data.streams.delegates.StreamListenerAdapter
org.gcube.data.streams.generators.LoggingListener<E>
- Type Parameters:
E - the type of stream elements
- All Implemented Interfaces:
- StreamListener, Generator<E,E>
public class LoggingListener<E>
- extends StreamListenerAdapter
- implements Generator<E,E>
A pass-through Generator that acts as a StreamListener for throughput logging purposes.
- Author:
- Fabio Simeoni
|
Method Summary |
void |
onClose()
Invoked then stream is closed. |
void |
onStart()
Invoked after the first element of the target Stream has been iterated over. |
E |
yield(E element)
Yields an element of a Stream from an element of another Stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggingListener
public LoggingListener()
onStart
public void onStart()
- Invoked after the first element of the target
Stream has been iterated over.
- Specified by:
onStart in interface StreamListener- Overrides:
onStart in class StreamListenerAdapter
yield
public E yield(E element)
- Yields an element of a
Stream from an element of another Stream.
- Specified by:
yield in interface Generator<E,E>
- Parameters:
element - the input element
- Returns:
- the output element
onClose
public void onClose()
- Invoked then stream is closed.
- Specified by:
onClose in interface StreamListener- Overrides:
onClose in class StreamListenerAdapter
Copyright © 2012. All Rights Reserved.