T
- the comparable typepublic class ComparableComparator<T extends java.lang.Comparable>
extends java.lang.Object
implements java.util.Comparator<T>, java.io.Serializable
Comparator
that compares Comparable
objects.Constructor and Description |
---|
ComparableComparator()
Constructor whose use should be avoided.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(T obj1,
T obj2)
Compare the two
Comparable arguments. |
boolean |
equals(java.lang.Object object) |
static <T> java.util.Comparator<T> |
getInstance()
Return the singleton instance of a ComparableComparator.
|
public ComparableComparator()
public static <T> java.util.Comparator<T> getInstance()
public int compare(T obj1, T obj2)
Comparable
arguments.compare
in interface java.util.Comparator<T extends java.lang.Comparable>
public boolean equals(java.lang.Object object)
equals
in interface java.util.Comparator<T extends java.lang.Comparable>
equals
in class java.lang.Object
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence