MCPcopy Create free account
hub / github.com/antlr/codebuff / greatestOf

Method greatestOf

output/java_guava/1.4.18/Ordering.java:833–837  ·  view source on GitHub ↗

Returns the k greatest elements of the given iterable according to this ordering, in order from greatest to least. If there are fewer than k elements present, all will be included. The implementation does not necessarily use a stable sorting algorithm; when multiple elemen

(Iterable<E> iterable, int k)

Source from the content-addressed store, hash-verified

831
832
833 public <E extends T> List<E> greatestOf(Iterable<E> iterable, int k) {
834 // TODO(kevinb): see if delegation is hurting performance noticeably
835 // TODO(kevinb): if we change this implementation, add full unit tests.
836 return reverse().leastOf(iterable, k);
837 }
838
839 /**
840 * Returns the {@code k} greatest elements from the given iterator according to

Callers

nothing calls this directly

Calls 2

reverseMethod · 0.95
leastOfMethod · 0.45

Tested by

no test coverage detected