limit


Description:

public Stream<T> limit (int n)

Returns a Stream limited to the first n elements.

Example:

    var first3 = stream.limit (3);

Parameters:

n

maximum number of elements.

Returns:

a new limited Stream.