My Trees class does implement Comparable...so I'm not sure it's that.
Also, how do I specify a Comparator to use...?
Thanks,
Alex
[post re-ordered]
>> Alex schreef:
>>
[quoted text clipped - 17 lines]
>> > knows that I will only be passing things of type Tree to the
>> > Colections.sort method?
[...]
>> Just guessing here, but I think you'll need to make the Tree class
>> implement Comparable. An other option is to use the Collections.sort()
>> method which also taks a Comparator.
[...]
> My Trees class does implement Comparable...so I'm not sure it's that.
Can you post the declaration of the Tree class? Something like:
public class Tree implements Comparable<Tree> {
> Also, how do I specify a Comparator to use...?
Use this method:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.uti
l.List,%20java.util.Comparator)
- Oliver