Here's an SSCCE for my issue. I need to do a sort of the Data.str field either in natural order or in reverse order depending on the value in Data.ascending. I managed to do this just fine in Data's compareTo() method, but now I'm trying to convert it to use Comarator. It mostly works but I can't figure out how to do the natural/reversed based on a value. Note that because the Data is sorted first by "ascending", by the time it needs to determine natural/reversed both arguments will be the same, either both natural or both reversed.
Yep. Well, it is a nasty one. I have a solution, but it is almost too ugly to show. So please don't shoot the messenger!
I could not make the Comparator static, since Data is an inner class. To get that Comparator anyway, I added an empty Constructor. And I cannot get the indentation up to standard, for some reason.
There are three kinds of actuaries: those who can count, and those who can't.