com.citra.comparators
Class ToStringComparator
java.lang.Object
com.citra.comparators.ToStringComparator
- All Implemented Interfaces:
- Serializable, Comparator
public class ToStringComparator
- extends Object
- implements Comparator, Serializable
This class is a comparator for comparing objects according to their toString() values.
It assumes that the objects being compared are not null.
- See Also:
- Serialized Form
Method Summary |
int |
compare(Object o1,
Object o2)
Compares its two arguments for order as defined by compare of the
Comparator interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ToStringComparator
public ToStringComparator()
- Creates a ToStringComparator.
compare
public int compare(Object o1,
Object o2)
- Compares its two arguments for order as defined by
compare
of the
Comparator
interface. o1
and o2
must be
not null, otherwise a NullPointerException will be thrown.
- Specified by:
compare
in interface Comparator
- Parameters:
o1
- the first object to be comparedo2
- the second object to be compared
- Returns:
- a negative integer, zero, or a positive integer as
o1
is less than, equal to, or greater than o2