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
ConstructorsConstructorDescriptionSlidingCollector(int size, int step) Creates a newSlidingCollectorinstance 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 aSetofCollector.Characteristicsindicating 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 typeAto 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 newSlidingCollectorinstance 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 typeAto the final result typeR.If the characteristic
IDENTITY_FINISHis set, this function may be presumed to be an identity transform with an unchecked cast fromAtoR. -
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 aSetofCollector.Characteristicsindicating the characteristics of this Collector. This set should be immutable.
-