Class ComparableComparator<V extends Comparable<V>>
java.lang.Object
org.javimmutable.collections.tree.ComparableComparator<V>
- All Implemented Interfaces:
Serializable
,Comparator<V>
@Immutable
public final class ComparableComparator<V extends Comparable<V>>
extends Object
implements Comparator<V>, Serializable
Comparator that uses the associated type's own compareTo() method.
Places null values before non-null values in its ordering.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
hashCode()
static <T extends Comparable<T>>
ComparableComparator<T> of()
Creates a type appropriate reference to the singleton instance of this class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ComparableComparator
public ComparableComparator()
-
-
Method Details
-
of
Creates a type appropriate reference to the singleton instance of this class. -
compare
- Specified by:
compare
in interfaceComparator<V extends Comparable<V>>
-
hashCode
public int hashCode() -
equals
- Specified by:
equals
in interfaceComparator<V extends Comparable<V>>
- Overrides:
equals
in classObject
-