Java java.util Comparator fields, constructors, methods, implement or subclass

Example usage for Java java.util Comparator fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util Comparator.

The text is from its open source code.

Implementation

java.util.Comparator has the following implementations.
Click this link to see all its implementation.

Constructor

Method

intcompare(T o1, T o2)
Compares its two arguments for order.
Comparatorcomparing( Function keyExtractor)
Accepts a function that extracts a java.lang.Comparable Comparable sort key from a type T , and returns a Comparator that compares by that sort key.
Comparatorcomparing(Function keyExtractor, Comparator keyComparator)
Accepts a function that extracts a sort key from a type T , and returns a Comparator that compares by that sort key using the specified Comparator .
ComparatorcomparingDouble(ToDoubleFunction keyExtractor)
Accepts a function that extracts a double sort key from a type T , and returns a Comparator that compares by that sort key.
ComparatorcomparingInt(ToIntFunction keyExtractor)
Accepts a function that extracts an int sort key from a type T , and returns a Comparator that compares by that sort key.
ComparatorcomparingLong(ToLongFunction keyExtractor)
Accepts a function that extracts a long sort key from a type T , and returns a Comparator that compares by that sort key.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this comparator.
ClassgetClass()
Returns the runtime class of this Object .
ComparatornaturalOrder()
Returns a comparator that compares Comparable objects in natural order.
ComparatornullsFirst(Comparator comparator)
Returns a null-friendly comparator that considers null to be less than non-null.
ComparatornullsLast(Comparator comparator)
Returns a null-friendly comparator that considers null to be greater than non-null.
Comparatorreversed()
Returns a comparator that imposes the reverse ordering of this comparator.
ComparatorreverseOrder()
Returns a comparator that imposes the reverse of the natural ordering.
ComparatorthenComparing(Comparator other)
Returns a lexicographic-order comparator with another comparator.
ComparatorthenComparing( Function keyExtractor)
Returns a lexicographic-order comparator with a function that extracts a Comparable sort key.
StringtoString()
Returns a string representation of the object.