some objects to a treeSet. This set has an overriden compareTo method, that is not working got me, that i can t edit. Some helps?
It would be helpful with a lil piece of code that we can see
You mean you have the TreeSet<T> and that T has "compareTo" implemented that you can't edit, right?
If my previous assumption is correct then this is easily solved via wrapper/decorator if all information for implementing "compareTo" is accessible via public methods of T. Otherwise if that info is accessible via public+protected methods then you end up with extending T.
Обсуждают сегодня