Java 8 Streams Java Java API
java.util.stream.DoubleStream
IntStream mapToInt(DoubleToIntFunction mapper)
This terminal operation returns an IntStream consisting of the results of applying the given function to the elements of this stream.
IntStream
package com.logicbig.example.doublestream;import java.util.stream.DoubleStream;import java.util.stream.IntStream;public class MapToIntExample { public static void main(String... args) { DoubleStream ds = DoubleStream.of(1.0, 1.2, 2.0, 2.4, 3.0); IntStream intStream = ds.mapToInt(Math::getExponent); intStream.forEach(System.out::println); }}
00111