public class TopNSorter<T> extends Object
Constructor and Description |
---|
TopNSorter(com.google.common.collect.Ordering<T> ordering)
Constructs a sorter that will sort items with given ordering.
|
Modifier and Type | Method and Description |
---|---|
Iterable<T> |
toTopN(Iterable<T> items,
int n)
Sorts a list of rows and retain the top n items
|
public TopNSorter(com.google.common.collect.Ordering<T> ordering)
ordering
- the order that this sorter instance will use for sortingCopyright © 2011–2016. All rights reserved.