util
Class NaturalComparator<T extends Comparable<Object>>
java.lang.Object
util.NaturalComparator<T>
- All Implemented Interfaces:
- Serializable, Comparator<T>, SerializableComparator<T>
public final class NaturalComparator<T extends Comparable<Object>>
- extends Object
- implements SerializableComparator<T>
A comparator that compares Objects using their natural order.
This is a convenience facade for the Comparable
interface.
- Since:
- v2.0
- Author:
- Steffen Zschaler
- See Also:
- Serialized Form
Method Summary |
int |
compare(T o1,
T o2)
Compare the two objects assuming they are both comparable . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NaturalComparator
public NaturalComparator()
compare
public final int compare(T o1,
T o2)
- Compare the two objects assuming they are both
comparable
.
- Specified by:
compare
in interface Comparator<T extends Comparable<Object>>
- Override:
- Never