Add groupingBy and eachCount sample.
This commit is contained in:
@@ -4448,6 +4448,8 @@ public header inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharArray.
|
||||
/**
|
||||
* Creates a [Grouping] source from an array to be used later with one of group-and-fold operations
|
||||
* using the specified [keySelector] function to extract a key from each element.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.groupingByEachCount
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header inline fun <T, K> Array<out T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
|
||||
|
||||
@@ -590,6 +590,8 @@ public header inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Iterabl
|
||||
/**
|
||||
* Creates a [Grouping] source from a collection to be used later with one of group-and-fold operations
|
||||
* using the specified [keySelector] function to extract a key from each element.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.groupingByEachCount
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header inline fun <T, K> Iterable<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
|
||||
|
||||
@@ -362,6 +362,8 @@ public header inline fun <T, K, V, M : MutableMap<in K, MutableList<V>>> Sequenc
|
||||
/**
|
||||
* Creates a [Grouping] source from a sequence to be used later with one of group-and-fold operations
|
||||
* using the specified [keySelector] function to extract a key from each element.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.groupingByEachCount
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header inline fun <T, K> Sequence<T>.groupingBy(crossinline keySelector: (T) -> K): Grouping<T, K>
|
||||
|
||||
@@ -425,6 +425,8 @@ public header inline fun <K, V, M : MutableMap<in K, MutableList<V>>> CharSequen
|
||||
/**
|
||||
* Creates a [Grouping] source from a char sequence to be used later with one of group-and-fold operations
|
||||
* using the specified [keySelector] function to extract a key from each character.
|
||||
*
|
||||
* @sample samples.collections.Collections.Transformations.groupingByEachCount
|
||||
*/
|
||||
@SinceKotlin("1.1")
|
||||
public header inline fun <K> CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping<Char, K>
|
||||
|
||||
Reference in New Issue
Block a user