com.generationjava.compare
Class ObjectComparator
java.lang.Object
com.generationjava.compare.ObjectComparator
- All Implemented Interfaces:
- Comparator
- public class ObjectComparator
- extends Object
- implements Comparator
Attempts to compare any Object.
Some standard types of objects can be dealt with immediately,
but others will need a Comparator being added with the static
registerComparator method.
The following are already handled:
Any extension of Comparable. This includes all the Number's and
String, Character amongst others.
java.net.URL is handled.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectComparator
public ObjectComparator()
registerComparator
public static void registerComparator(Class clss,
Comparator c)
- Register a Comparator to be used to compare a particular Class.
getComparator
public static Comparator getComparator(Class clss)
- Get the Comparator to be used for a particular Class.
If no Comparator is available, then it will search the
inheritence tree for one.
compare
public int compare(Object o1,
Object o2)
- Specified by:
compare in interface Comparator
Copyright © 2000-2005 OSJava. All Rights Reserved.