util
Class NaturalComparator
java.lang.Object
util.NaturalComparator
- All Implemented Interfaces:
- Comparator, Serializable, SerializableComparator
- public final class NaturalComparator
- extends Object
- implements SerializableComparator
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
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(Object o1,
Object o2)
- Compare the two objects assuming they are both
comparable
.
- Specified by:
compare
in interface Comparator
- Override:
- Never