Example usage for java.util.stream DoubleStream mapToInt

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

Introduction

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

Prototype

IntStream mapToInt(DoubleToIntFunction mapper);

Source Link

Document

Returns an IntStream consisting of the results of applying the given function to the elements of this stream.

Usage

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.mapToInt(n -> {
        return (int) (n * n);
    }).forEach(System.out::println);
}