Package org.aksw.commons.util.stream
Interface Streamer<V,T>
- Type Parameters:
V- The type of the store from which to stream itemsT- The item type to stream
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A streamer returns a stream of items from a collection-like object (referred to as a 'store')
given as the argument. For example, in the case of a map data structure a
streamer may return any of its key, value or entry set. If the actual
type of the collection is not known the {
streamRaw(Object) method
should be used.- Author:
- Claus Stadler 11/09/2020
-
Method Summary
Modifier and TypeMethodDescriptionConvenience method to derive a new streamer that transforms the items emitted by the original streamer.mapStream(StreamFunction<T, U> streamTransform) Convenience method that yields a new Streamer that wraps this streamer such that its streams are transformed by the given streamTransform.Delegate tostream(Object).
-
Method Details
-
stream
-
mapStream
Convenience method that yields a new Streamer that wraps this streamer such that its streams are transformed by the given streamTransform.- Type Parameters:
U-- Parameters:
streamTransform-- Returns:
-
mapItems
Convenience method to derive a new streamer that transforms the items emitted by the original streamer.- Type Parameters:
U-- Parameters:
itemTransform-- Returns:
-
streamRaw
Delegate tostream(Object).- Parameters:
store-- Returns:
- A stream from given store. Arguments of incorrect type will cause a
ClassCastException.
-