View Single Post
Old 07-15-2004, 03:55 AM   #8 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,175
Belisarius is on a distinguished road
The only way I can think of to hold it outside the class is with a singleton, at which point you've just really raised the complexity just to sort.

Like I said, I use Comparable to enforce natural ordering, but if I want to sort in more than one way, I use Comparator. Granted, it is a bit of a hack designed to pass a method to a method, but it simply is the way to go when using different sort methods on the same object.
__________________
GitS
Belisarius is offline   Reply With Quote