Sorting an ArrayList of objects by an instance variable... an int array.
807600Aug 26 2007 — edited Aug 26 2007Dear all,
This cry for help is brought to you off the back of 48 hours of planning, coding and tweaking, then dispairing and repeating. I'm sure this 'process' is an old friend to some of you. Hopefully it makes us all stronger!
As the title says I have not been able to sort an ArrayList of objects according to one of the objects' instance variables, which is a one dimensional int array.
I have explored the idea of using Comparable but don't seem to be able to get it to compare full arrays and repeatedly comparing individual elements of the arrays is pretty much what I've spent a large chunk o' time trying to (unsuccessfully) implement using a series of nested and highly convoluted for loops and if statements.
Any help would be warmly received but assistance leading to a resolution would simply make my year.
Thanks
Alistair