Class SlidingCollector<T>
java.lang.Object
com.ggalmazor.ltdownsampling.tools.SlidingCollector<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics
-
Constructor Summary
ConstructorDescriptionSlidingCollector
(int size, int step) Creates a newSlidingCollector
instance with the provided configuration -
Method Summary
Modifier and TypeMethodDescriptionBiConsumer<List<List<T>>,
T> A function that folds a value into a mutable result container.Returns aSet
ofCollector.Characteristics
indicating the characteristics of this Collector.BinaryOperator<List<List<T>>>
combiner()
A function that accepts two partial results and merges them.finisher()
Perform the final transformation from the intermediate accumulation typeA
to the final result typeR
.supplier()
A function that creates and returns a new mutable result container.
-
Constructor Details
-
SlidingCollector
public SlidingCollector(int size, int step) Creates a newSlidingCollector
instance with the provided configuration- Parameters:
size
- the number of elements on each list element in the output liststep
- the number of input elements to skip after each list element in the output list
-
-
Method Details
-
supplier
A function that creates and returns a new mutable result container. -
accumulator
A function that folds a value into a mutable result container. -
finisher
Perform the final transformation from the intermediate accumulation typeA
to the final result typeR
.If the characteristic
IDENTITY_FINISH
is set, this function may be presumed to be an identity transform with an unchecked cast fromA
toR
. -
combiner
A function that accepts two partial results and merges them. The combiner function may fold state from one argument into the other and return that, or may return a new result container. -
characteristics
Returns aSet
ofCollector.Characteristics
indicating the characteristics of this Collector. This set should be immutable.
-