English | 简体中文

api-docs / org.ktorm.entity / aggregate

aggregate

inline fun <E : Any, K : Any, R> EntityGrouping<E, *, K>.aggregate(
    operation: (key: K?, accumulator: R?, element: E, first: Boolean) -> R
): Map<K?, R>
(source code)

Groups elements from the source sequence by key and applies operation to the elements of each group sequentially,
passing the previously accumulated value and the current element as arguments, and stores the results in a new map.

This function is delegated to Grouping.aggregate, more details can be found in its documentation.