Example usage for java.util.stream DoubleStream limit

List of usage examples for java.util.stream DoubleStream limit

Introduction

In this page you can find the example usage for java.util.stream DoubleStream limit.

Prototype

DoubleStream limit(long maxSize);

Source Link

Document

Returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length.

Usage

From source file:Main.java

public static void main(String[] args) {
    DoubleStream i = DoubleStream.iterate(1.2, d -> d * d);
    i.limit(3).forEach(System.out::println);
}

From source file:Main.java

public static void main(String[] args) {
    DoubleStream b = DoubleStream.of(1.1, 2.2, 3.3, 4.4, 5.5);
    b.limit(2).forEach(System.out::println);
}

From source file:Main.java

public static void main(String[] args) {
    DoubleStream b = DoubleStream.of(1.1, 2.2, 3.3, 4.4, 5.5);
    b.limit(2).peek(System.out::println);
}