IncludingSelf

A ReductionType that includes the local value in the reduction.

Functions

Link copied to clipboard
inline fun <ID : Any, T, R> ReductionType.init(field: Field<ID, T>, default: R, crossinline self: (FieldEntry<ID, T>) -> R): R

Computes the initial value for a reduction using a FieldEntry, based on whether the local value is included.

inline fun <ID : Any, T, R> ReductionType.init(field: Field<ID, T>, default: R, crossinline self: (ID, T) -> R): R

Computes the initial value for a reduction, depending on whether the local value is included.

Link copied to clipboard
fun <R> ReductionType.initTo(default: R, self: R): R

Selects the initial value for a reduction based on whether the local value is included.