Top Description Constructors Methods
org.jooq.lambda

public Class Agg

extends Object
Class Inheritance
Static Imports
java.util.Comparator.comparing, .Comparator.naturalOrder, java.util.stream.Collectors.*, org.jooq.lambda.tuple.Tuple.collectors, .Tuple.tuple

A set of additional Collector implementations.

The class name isn't set in stone and will change.

Authors
Lukas Eder, Jichen Lu

Constructor Summary

AccessConstructor and Description
public
Agg()

Method Summary

Modifier and TypeMethod and Description
public static Collector<Boolean, ?, Boolean>
allMatch()

Get a Collector that calculates the ALL() function.

public static <T> Collector<T, ?, Boolean>
allMatch(Predicate<? super T> predicate)

Get a Collector that calculates the ALL() function.

public static Collector<Boolean, ?, Boolean>
anyMatch()

Get a Collector that calculates the ANY() function.

public static <T> Collector<T, ?, Boolean>
anyMatch(Predicate<? super T> predicate)

Get a Collector that calculates the ANY() function.

public static <T> Collector<T, ?, Optional<T>>
avg()

Get a Collector that calculates the AVG() for any type of Number.

public static <T, U> Collector<T, ?, Optional<U>>
avg(Function<? super T, ? extends U> function)

Get a Collector that calculates the AVG() for any type of Number.

private static <T> double
avg0(List<T> list, ToDoubleFunction<? super T> function)

public static <T> Collector<T, ?, Optional<T>>
bitAnd()

Get a Collector that calculates BIT_AND() for any type of Number.

public static <T, U> Collector<T, ?, Optional<U>>
bitAnd(Function<? super T, ? extends U> function)

Get a Collector that calculates the BIT_AND() for any type of Number.

public static <T> Collector<T, ?, Integer>
bitAndInt(ToIntFunction<? super T> function)

Get a Collector that calculates the BIT_AND() for any type of Number.

public static <T> Collector<T, ?, Long>
bitAndLong(ToLongFunction<? super T> function)

Get a Collector that calculates the BIT_AND() for any type of Number.

public static <T> Collector<T, ?, Optional<T>>
bitOr()

Get a Collector that calculates BIT_OR() for any type of Number.

public static <T, U> Collector<T, ?, Optional<U>>
bitOr(Function<? super T, ? extends U> function)

Get a Collector that calculates the BIT_OR() for any type of Number.

public static <T> Collector<T, ?, Integer>
bitOrInt(ToIntFunction<? super T> function)

Get a Collector that calculates the BIT_OR() for any type of Number.

public static <T> Collector<T, ?, Long>
bitOrLong(ToLongFunction<? super T> function)

Get a Collector that calculates the BIT_OR() for any type of Number.

public static Collector<CharSequence, ?, String>
commonPrefix()

Get a Collector that calculates the common prefix of a set of strings.

public static Collector<CharSequence, ?, String>
commonSuffix()

Get a Collector that calculates the common suffix of a set of strings.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
correlationDouble()

Get a Collector that calculates the CORR() function.

public static <T> Collector<T, ?, Optional<Double>>
correlationDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the CORR() function.

public static <T> Collector<T, ?, Long>
count()

Get a Collector that calculates the COUNT(*) function.

public static <T> Collector<T, ?, Long>
countDistinct()

Get a Collector that calculates the COUNT (DISTINCT *) function.

public static <T, U> Collector<T, ?, Long>
countDistinctBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the COUNT (DISTINCT expr) function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
covarianceDouble()

Get a Collector that calculates the COVAR_POP() function.

public static <T> Collector<T, ?, Optional<Double>>
covarianceDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the COVAR_POP() function.

private static <T> Function<List<T>, Optional<Double>>
covarianceFinisher(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY, BiFunction<List<T>, ToDoubleFunction<? super T>, Double> sumOrAvg)

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<Long>>
denseRank(T value)

Get a Collector that calculates the DENSE_RANK() function given natural ordering.

public static <T> Collector<T, ?, Optional<Long>>
denseRank(T value, Comparator<? super T> comparator)

Get a Collector that calculates the DENSE_RANK() function given a specific ordering.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Long>>
denseRankBy(U value, Function<? super T, ? extends U> function)

Get a Collector that calculates the derived DENSE_RANK() function given natural ordering.

public static <T, U> Collector<T, ?, Optional<Long>>
denseRankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived DENSE_RANK() function given a specific ordering.

public static <T> Collector<T, ?, Seq<T>>
dropping(long n)

Get a Collector that skip the first n elements of a collection.

public static <T, A, R> Collector<T, ?, R>
filter(Predicate<? super T> predicate, Collector<T, A, R> downstream)

Get a Collector that filters data passed to downstream collector.

public static <T> Collector<T, ?, Optional<T>>
first()

Get a Collector that calculates the FIRST function.

public static <T> Collector<T, ?, Optional<T>>
last()

Get a Collector that calculates the LAST function.

private static <T1, T2, R> Optional<R>
mapAll(Tuple2<Optional<T1>, Optional<T2>> tuple, Function2<T1, T2, R> function)

private static <T1, T2, T3, R> Optional<R>
mapAll(Tuple3<Optional<T1>, Optional<T2>, Optional<T3>> tuple, Function3<T1, T2, T3, R> function)

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>>
max()

Get a Collector that calculates the MAX() function.

public static <T> Collector<T, ?, Optional<T>>
max(Comparator<? super T> comparator)

Get a Collector that calculates the MAX() function.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>>
max(Function<? super T, ? extends U> function)

Get a Collector that calculates the MAX() function.

public static <T, U> Collector<T, ?, Optional<U>>
max(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MAX() function.

public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>>
maxAll()

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T> Collector<T, ?, Seq<T>>
maxAll(Comparator<? super T> comparator)

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<U>>
maxAll(Function<? super T, ? extends U> function)

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T, U> Collector<T, ?, Seq<U>>
maxAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<T>>
maxAllBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T, U> Collector<T, ?, Seq<T>>
maxAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MAX() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<T>>
maxBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MAX() function.

public static <T, U> Collector<T, ?, Optional<T>>
maxBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MAX() function.

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>>
median()

Get a Collector that calculates the MEDIAN() function given natural ordering.

public static <T> Collector<T, ?, Optional<T>>
median(Comparator<? super T> comparator)

Get a Collector that calculates the MEDIAN() function given a specific ordering.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>>
median(Function<? super T, ? extends U> function)

Get a Collector that calculates the MEDIAN() function given a specific ordering.

public static <T, U> Collector<T, ?, Optional<U>>
median(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MEDIAN() function given a specific ordering.

public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>>
medianAll()

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T> Collector<T, ?, Seq<T>>
medianAll(Comparator<? super T> comparator)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<T>>
medianAllBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the derived PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T, U> Collector<T, ?, Seq<T>>
medianAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived MEDIAN() function given natural ordering, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<T>>
medianBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the derived MEDIAN() function given natural ordering.

public static <T, U> Collector<T, ?, Optional<T>>
medianBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived MEDIAN() function given a specific ordering.

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>>
min()

Get a Collector that calculates the MIN() function.

public static <T> Collector<T, ?, Optional<T>>
min(Comparator<? super T> comparator)

Get a Collector that calculates the MIN() function.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>>
min(Function<? super T, ? extends U> function)

Get a Collector that calculates the MIN() function.

public static <T, U> Collector<T, ?, Optional<U>>
min(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MIN() function.

public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>>
minAll()

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T> Collector<T, ?, Seq<T>>
minAll(Comparator<? super T> comparator)

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<U>>
minAll(Function<? super T, ? extends U> function)

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T, U> Collector<T, ?, Seq<U>>
minAll(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<T>>
minAllBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T, U> Collector<T, ?, Seq<T>>
minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MIN() function, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<T>>
minBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MIN() function.

public static <T, U> Collector<T, ?, Optional<T>>
minBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the MIN() function.

public static <T> Collector<T, ?, Optional<T>>
mode()

Get a Collector that calculates the MODE() function.

private static <T, X> Collector<T, ?, X>
mode0(Function<? super Seq<Tuple2<T, Long>>, ? extends X> transformer)

public static <T> Collector<T, ?, Seq<T>>
modeAll()

Get a Collector that calculates the MODE() function.

public static <T, U> Collector<T, ?, Seq<T>>
modeAllBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MODE() function.

public static <T, U> Collector<T, ?, Optional<T>>
modeBy(Function<? super T, ? extends U> function)

Get a Collector that calculates the MODE() function.

public static Collector<Boolean, ?, Boolean>
noneMatch()

Get a Collector that calculates the NONE() function.

public static <T> Collector<T, ?, Boolean>
noneMatch(Predicate<? super T> predicate)

Get a Collector that calculates the NONE() function.

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<T>>
percentile(double percentile)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given natural ordering.

public static <T> Collector<T, ?, Optional<T>>
percentile(double percentile, Comparator<? super T> comparator)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>>
percentile(double percentile, Function<? super T, ? extends U> function)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering.

public static <T, U> Collector<T, ?, Optional<U>>
percentile(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering.

public static <T extends Comparable<? super T>> Collector<T, ?, Seq<T>>
percentileAll(double percentile)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T> Collector<T, ?, Seq<T>>
percentileAll(double percentile, Comparator<? super T> comparator)

Get a Collector that calculates the PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Seq<T>>
percentileAllBy(double percentile, Function<? super T, ? extends U> function)

Get a Collector that calculates the derived PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T, U> Collector<T, ?, Seq<T>>
percentileAllBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived PERCENTILE_DISC(percentile) function given a specific ordering, producing multiple results.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<T>>
percentileBy(double percentile, Function<? super T, ? extends U> function)

Get a Collector that calculates the derived PERCENTILE_DISC(percentile) function given natural ordering.

public static <T, U> Collector<T, ?, Optional<T>>
percentileBy(double percentile, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived PERCENTILE_DISC(percentile) function given a specific ordering.

private static <T, U, R> Collector<T, List<Tuple2<T, U>>, R>
percentileCollector(Function<? super T, ? extends U> function, Comparator<? super U> comparator, Supplier<R> onEmpty, Function<T, R> onSingle, Function<List<Tuple2<T, U>>, R> finisher)

private static int
percentileIndex(double percentile, int size)

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<Double>>
percentRank(T value)

Get a Collector that calculates the PERCENT_RANK() function given natural ordering.

public static <T> Collector<T, ?, Optional<Double>>
percentRank(T value, Comparator<? super T> comparator)

Get a Collector that calculates the PERCENT_RANK() function given a specific ordering.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Double>>
percentRankBy(U value, Function<? super T, ? extends U> function)

Get a Collector that calculates the derived PERCENT_RANK() function given natural ordering.

public static <T, U> Collector<T, ?, Optional<Double>>
percentRankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived PERCENT_RANK() function given a specific ordering.

public static <T extends Comparable<? super T>> Collector<T, ?, Optional<Long>>
rank(T value)

Get a Collector that calculates the RANK() function given natural ordering.

public static <T> Collector<T, ?, Optional<Long>>
rank(T value, Comparator<? super T> comparator)

Get a Collector that calculates the RANK() function given a specific ordering.

public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<Long>>
rankBy(U value, Function<? super T, ? extends U> function)

Get a Collector that calculates the derived RANK() function given natural ordering.

public static <T, U> Collector<T, ?, Optional<Long>>
rankBy(U value, Function<? super T, ? extends U> function, Comparator<? super U> comparator)

Get a Collector that calculates the derived RANK() function given a specific ordering.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrAvgXDouble()

Get a Collector that calculates the REGR_AVGX() function.

public static <T> Collector<T, ?, Optional<Double>>
regrAvgXDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_AVGX() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrAvgYDouble()

Get a Collector that calculates the REGR_AVGY() function.

public static <T> Collector<T, ?, Optional<Double>>
regrAvgYDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_AVGY() function.

public static Collector<Tuple2<Double, Double>, ?, Long>
regrCount()

Get a Collector that calculates the REGR_COUNT() function.

public static <T> Collector<T, ?, Long>
regrCount(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_COUNT() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrInterceptDouble()

Get a Collector that calculates the REGR_INTERCEPT() function.

public static <T> Collector<T, ?, Optional<Double>>
regrInterceptDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_INTERCEPT() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrR2Double()

Get a Collector that calculates the regrR2Double() function.

public static <T> Collector<T, ?, Optional<Double>>
regrR2Double(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the regrR2Double() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrSlopeDouble()

Get a Collector that calculates the REGR_SLOPE() function.

public static <T> Collector<T, ?, Optional<Double>>
regrSlopeDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_SLOPE() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrSxxDouble()

Get a Collector that calculates the REGR_SXX() function.

public static <T> Collector<T, ?, Optional<Double>>
regrSxxDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_SXX() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrSxyDouble()

Get a Collector that calculates the REGR_SXY() function.

public static <T> Collector<T, ?, Optional<Double>>
regrSxyDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_SXY() function.

public static Collector<Tuple2<Double, Double>, ?, Optional<Double>>
regrSyyDouble()

Get a Collector that calculates the REGR_SYY() function.

public static <T> Collector<T, ?, Optional<Double>>
regrSyyDouble(ToDoubleFunction<? super T> functionX, ToDoubleFunction<? super T> functionY)

Get a Collector that calculates the REGR_SYY() function.

public static <T> Collector<Double, ?, Optional<Double>>
stddevDouble()

Get a Collector that calculates the STDDEV_POP() function.

public static <T, U> Collector<T, ?, Optional<Double>>
stddevDouble(ToDoubleFunction<? super T> function)

Get a Collector that calculates the STDDEV_POP() function.

public static <T> Collector<T, ?, Optional<T>>
sum()

Get a Collector that calculates the SUM() for any type of Number.

public static <T, U> Collector<T, ?, Optional<U>>
sum(Function<? super T, ? extends U> function)

Get a Collector that calculates the SUM() for any type of Number.

private static <T> double
sum0(List<T> list, ToDoubleFunction<? super T> function)

public static <T> Collector<T, ?, Seq<T>>
taking(long n)

Get a Collector that takes the first n elements from a collection.

private static <T> double
variance0(List<T> l, ToDoubleFunction<? super T> function)

public static Collector<Double, ?, Optional<Double>>
varianceDouble()

Get a Collector that calculates the VAR_POP() function.

public static <T> Collector<T, ?, Optional<Double>>
varianceDouble(ToDoubleFunction<? super T> function)

Get a Collector that calculates the VAR_POP() function.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait