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

Method from

output/java_guava/1.4.18/Ordering.java:164–169  ·  view source on GitHub ↗

Returns an ordering based on an existing comparator instance. Note that it is unnecessary to create a new anonymous inner class implementing Comparator just to pass it in here. Instead, simply subclass Ordering and implement its compare method directly. @param

(Comparator<T> comparator)

Source from the content-addressed store, hash-verified

162 */
163
164 @GwtCompatible(serializable = true)
165 public static <T> Ordering<T> from(Comparator<T> comparator) {
166 return (comparator instanceof Ordering)
167 ? (Ordering<T>) comparator
168 : new ComparatorOrdering<T>(comparator);
169 }
170
171 /**
172 * Simply returns its argument.

Callers 15

descendingMultisetMethod · 0.95
reverseMethod · 0.95
buildMethod · 0.95
orderingMethod · 0.95
buildMethod · 0.95
createDescendingSetMethod · 0.95
toSortedListMethod · 0.95
buildMethod · 0.95
reverseMethod · 0.95
fromEntriesMethod · 0.95

Calls 1

checkNotNullMethod · 0.45

Tested by

no test coverage detected