Gatherers.WindowSliding(Int32) Method

Definition

Returns a Gatherer that gathers elements into windows -- encounter-ordered groups of elements -- of a given size, where each subsequent window includes all elements of the previous window except for the least recent, and adds the next element in the stream.

[Android.Runtime.Register("windowSliding", "(I)Ljava/util/stream/Gatherer;", "", ApiSince=36)]
[Java.Interop.JavaTypeParameters(new System.String[] { "TR" })]
public static Java.Util.Streams.IGatherer? WindowSliding(int windowSize);
[<Android.Runtime.Register("windowSliding", "(I)Ljava/util/stream/Gatherer;", "", ApiSince=36)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "TR" })>]
static member WindowSliding : int -> Java.Util.Streams.IGatherer

Parameters

windowSize
Int32

the size of the windows

Returns

a new gatherer which groups elements into sliding windows

Attributes

Remarks

Returns a Gatherer that gathers elements into windows -- encounter-ordered groups of elements -- of a given size, where each subsequent window includes all elements of the previous window except for the least recent, and adds the next element in the stream. If the stream is empty then no window will be produced. If the size of the stream is smaller than the window size then only one window will be produced, containing all elements in the stream.

Example: {

Java documentation for java.util.stream.Gatherers.windowSliding(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to