MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / getReverse

Method getReverse

JSAT/src/jsat/utils/IndexTable.java:43–53  ·  view source on GitHub ↗

Obtains the reverse order comparator @param the data type @param cmp the original comparator @return the reverse order comparator

(final Comparator<T> cmp)

Source from the content-addressed store, hash-verified

41 * @return the reverse order comparator
42 */
43 public static <T> Comparator<T> getReverse(final Comparator<T> cmp)
44 {
45 return new Comparator<T>()
46 {
47 @Override
48 public int compare(T o1, T o2)
49 {
50 return -cmp.compare(o1, o2);
51 }
52 };
53 }
54
55 /**
56 * We use an array of Integer objects instead of integers because we need

Callers 1

sortRMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected