Here you can find the source of maxLong(Stream
Parameter | Description |
---|---|
stream | the Stream of Long to find the maximum of |
public static long maxLong(Stream<Long> stream)
//package com.java2s; //License from project: Open Source License import java.util.stream.LongStream; import java.util.stream.Stream; public class Main { /**// ww w. ja va 2s. c om * Returns the highest value on a stream of longs * * @param stream the Stream of Long to find the maximum of * @return the highest value on the stream */ public static long maxLong(Stream<Long> stream) { return stream.mapToLong(Long::valueOf).max().getAsLong(); } /** * Returns the highest value on a stream of longs * * @param stream the LongStream to find the maximum of * @return the highest value on the stream */ public static long maxLong(LongStream stream) { return stream.max().getAsLong(); } }