ComposableStatistic

interface ComposableStatistic<T, I, R> : Statistic<T, R>

A statistic tha could be computed separately on different blocks of data and then composed

Parameters

T
  • source type

I
  • intermediate block type

R
  • result type

Functions

composeIntermediate
Link copied to clipboard
common
abstract suspend fun composeIntermediate(first: I, second: I): I
computeIntermediate
Link copied to clipboard
common
abstract suspend fun computeIntermediate(data: Buffer<T>): I
evaluate
Link copied to clipboard
common
open suspend override fun evaluate(data: Buffer<T>): R
toResult
Link copied to clipboard
common
abstract suspend fun toResult(intermediate: I): R

Inheritors

Mean
Link copied to clipboard

Extensions

flow
Link copied to clipboard
common
fun <T, I, R> ComposableStatistic<T, I, R>.flow(flow: Flow<Buffer<T>>, dispatcher: CoroutineDispatcher = Dispatchers.Default): Flow<R>
Perform a streaming statistical analysis on a chunked data.