Example usage for Java java.util Comparator fields, constructors, methods, implement or subclass
The text is from its open source code.
int | compare(T o1, T o2) Compares its two arguments for order. |
Comparator | comparing( Function super T, ? extends U> keyExtractor) Accepts a function that extracts a java.lang.Comparable Comparable sort key from a type T , and returns a Comparator |
Comparator | comparing(Function super T, ? extends U> keyExtractor, Comparator super U> keyComparator) Accepts a function that extracts a sort key from a type T , and returns a Comparator |
Comparator | comparingDouble(ToDoubleFunction super T> keyExtractor) Accepts a function that extracts a double sort key from a type T , and returns a Comparator |
Comparator | comparingInt(ToIntFunction super T> keyExtractor) Accepts a function that extracts an int sort key from a type T , and returns a Comparator |
Comparator | comparingLong(ToLongFunction super T> keyExtractor) Accepts a function that extracts a long sort key from a type T , and returns a Comparator |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this comparator. |
Class> | getClass() Returns the runtime class of this Object . |
Comparator | naturalOrder() Returns a comparator that compares Comparable objects in natural order. |
Comparator | nullsFirst(Comparator super T> comparator) Returns a null-friendly comparator that considers null to be less than non-null. |
Comparator | nullsLast(Comparator super T> comparator) Returns a null-friendly comparator that considers null to be greater than non-null. |
Comparator | reversed() Returns a comparator that imposes the reverse ordering of this comparator. |
Comparator | reverseOrder() Returns a comparator that imposes the reverse of the natural ordering. |
Comparator | thenComparing(Comparator super T> other) Returns a lexicographic-order comparator with another comparator. |
Comparator | thenComparing( Function super T, ? extends U> keyExtractor) Returns a lexicographic-order comparator with a function that extracts a Comparable sort key. |
String | toString() Returns a string representation of the object. |