public class StreamUtils extends Object
| Constructor and Description |
|---|
StreamUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.stream.Stream<T> |
appendAction(java.util.stream.Stream<? extends T> stream,
Runnable runnable)
Creates a new stream which upon reaching its end performs and action.
|
static <T> java.util.stream.Stream<List<T>> |
mapToBatch(java.util.stream.Stream<T> stream,
int batchSize)
Note we could implement another version where each batch's List is lazy loaded from the stream -
but this would probably require complete consumption of each batch in order
|
static <S,X> java.util.stream.Stream<X> |
stream(java.util.function.BiConsumer<S,java.util.function.Consumer<X>> fn,
S baseSolution) |
public static <T> java.util.stream.Stream<List<T>> mapToBatch(java.util.stream.Stream<T> stream, int batchSize)
stream - batchSize - public static <T> java.util.stream.Stream<T> appendAction(java.util.stream.Stream<? extends T> stream, Runnable runnable)
stream - runnable - public static <S,X> java.util.stream.Stream<X> stream(java.util.function.BiConsumer<S,java.util.function.Consumer<X>> fn, S baseSolution)
Copyright © 2018. All rights reserved.