All Packages Class Hierarchy This Package Previous Next Index
Class collections.DefaultComparator
java.lang.Object
|
+----collections.DefaultComparator
- public class DefaultComparator
- extends Object
- implements Comparator
DefaultComparator provides a general-purpose but slow compare
operation.
-
DefaultComparator()
-
-
compare(Object, Object)
-
Try various downcasts to find a basis for
comparing two elements.
DefaultComparator
public DefaultComparator()
compare
public int compare(Object fst,
Object snd)
- Try various downcasts to find a basis for
comparing two elements. If all else fails, just compare
hashCodes(). This can be effective when you are
using an ordered implementation data structure like trees,
but don't really care about ordering.
- Parameters:
- fst - first argument
- snd - second argument
- Returns:
- a negative number if fst is less than snd; a
positive number if fst is greater than snd; else 0
All Packages Class Hierarchy This Package Previous Next Index