Kotlin HashSet windowed()
Syntax & Examples


Syntax of HashSet.windowed()

There are 2 variations for the syntax of HashSet.windowed() extension function. They are:

1.
fun <T> Iterable<T>.windowed( size: Int, step: Int = 1, partialWindows: Boolean = false ): List<List<T>>

This extension function returns a list of snapshots of the window of the given size sliding along this collection with the given step, where each snapshot is a list.

2.
fun <T, R> Iterable<T>.windowed( size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List<T>) -> R ): List<R>

This extension function returns a list of results of applying the given transform function to an each list representing a view over the window of the given size sliding along this collection with the given step.