| java.lang.Object com.jidesoft.comparator.DefaultComparator
DefaultComparator | public class DefaultComparator implements Comparator(Code) | | Badly named, this class compares objects by first converting them to
Strings using the toString method.
|
Constructor Summary | |
protected | DefaultComparator() Constructor.
Has protected access to prevent other clients creating instances of the
class ... |
DefaultComparator | protected DefaultComparator()(Code) | | Constructor.
Has protected access to prevent other clients creating instances of the
class ... it is stateless so we need only one instance.
|
compare | public int compare(Object o1, Object o2)(Code) | | Compares two Objects using the toString() method as the
value of each object to compare.
Parameters: o1 - the first object to be compared Parameters: o2 - the second object to be compared 0 if a and b are equal, -1 if a b, 1 if a b |
getInstance | public static DefaultComparator getInstance()(Code) | | Returns ObjectComparator singleton.
an instance of DefaultComparator. |
|
|