Henry Wong wrote:
Actually, the java.util.Comparator interface sounds more like what is needed.
Henry
Hmm, Comparator sounds better than Comparable because we wont force every class to implement an interface at least.
The problem is that most of these classes already have a method for comparison, so writing Comparator implementations seems like a lot of duplicate code. I agree that it's the proper way though.
BTW, I found
http://java.sun.com/docs/white/delegates.html and I must say that it surely aint written in the most unbiased tone that I've seen.
