Tuesday, November 18, 2003 08:35 AM
Well, you can create an object that implements the java.util.Comparator
To do that just simply implement the compare(Object obj1, Object obj2)
and equals(Object obj)
Based on your needs you can create one or more simple comparators or even more comparators that work based on parameter that are provided on creation.
Then, once you have your comparator(s), sorting your list is as simple as calling the Collections.sort(List list, Comparator c) method.