/** * Invokes a transform function on each element of a * sequence and returns the minimum Double value. */ public static <TSource> double min(Enumerable<TSource> source, DoubleFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.DOUBLE_MIN); }
/** * Invokes a transform function on each element of a * sequence and returns the maximum Float value. */ public static <TSource> float max(Enumerable<TSource> source, FloatFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.FLOAT_MAX); }
/** * Computes the sum of the sequence of int values * that are obtained by invoking a transform function on each * element of the input sequence. */ public static <TSource> int sum(Enumerable<TSource> source, IntegerFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), 0, Extensions.INTEGER_SUM); }
/** * Computes the sum of the sequence of long values * that are obtained by invoking a transform function on each * element of the input sequence. */ public static <TSource> long sum(Enumerable<TSource> source, LongFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), 0L, Extensions.LONG_SUM); }
/** * Invokes a transform function on each element of a * sequence and returns the maximum Double value. */ public static <TSource> double max(Enumerable<TSource> source, DoubleFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.DOUBLE_MAX); }
/** * Invokes a transform function on each element of a * sequence and returns the minimum int value. */ public static <TSource> int min(Enumerable<TSource> source, IntegerFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.INTEGER_MIN); }
/** * Computes the sum of the sequence of Double values * that are obtained by invoking a transform function on each * element of the input sequence. */ public static <TSource> double sum(Enumerable<TSource> source, DoubleFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), 0d, Extensions.DOUBLE_SUM); }
/** * Computes the sum of the sequence of Float values * that are obtained by invoking a transform function on each * element of the input sequence. */ public static <TSource> float sum(Enumerable<TSource> source, FloatFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), 0F, Extensions.FLOAT_SUM); }
/** * Invokes a transform function on each element of a * sequence and returns the maximum int value. */ public static <TSource> int max(Enumerable<TSource> source, IntegerFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.INTEGER_MAX); }
/** * Invokes a transform function on each element of a * sequence and returns the maximum long value. */ public static <TSource> long max(Enumerable<TSource> source, LongFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.LONG_MAX); }
/** * Invokes a transform function on each element of a * sequence and returns the minimum long value. */ public static <TSource> long min(Enumerable<TSource> source, LongFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.LONG_MIN); }
/** * Invokes a transform function on each element of a * sequence and returns the minimum Float value. */ public static <TSource> float min(Enumerable<TSource> source, FloatFunction1<TSource> selector) { return aggregate(source.select(adapt(selector)), null, Extensions.FLOAT_MIN); }