Package | Description |
---|---|
com.google.common.collect |
This package contains generic collection interfaces and implementations, and
other utilities for working with collections.
|
Modifier and Type | Method and Description |
---|---|
static <T extends java.lang.Comparable<? super T>> |
TopKSelector.greatest(int k)
Returns a
TopKSelector that collects the greatest k elements added to it,
relative to the natural ordering of the elements, and returns them via topK() in
descending order. |
static <T> TopKSelector<T> |
TopKSelector.greatest(int k,
java.util.Comparator<? super T> comparator)
Returns a
TopKSelector that collects the greatest k elements added to it,
relative to the specified comparator, and returns them via topK() in descending order. |
static <T extends java.lang.Comparable<? super T>> |
TopKSelector.least(int k)
Returns a
TopKSelector that collects the lowest k elements added to it,
relative to the natural ordering of the elements, and returns them via topK() in
ascending order. |
static <T> TopKSelector<T> |
TopKSelector.least(int k,
java.util.Comparator<? super T> comparator)
Returns a
TopKSelector that collects the lowest k elements added to it,
relative to the specified comparator, and returns them via topK() in ascending order. |