I have an ArrayList, which contains X amount of Strings. Each string array has stuff like Name, Surname, Address, Town, etc.
I want to be able to sort the ArrayList of arrays, by a specified entry in each array. name, or surname, or... etc. I assume there would be a sort method, which would take a parameter searchBy or something like that.
I assume you can guarentee the ordering of you String arrays? So you know that surname is always element 2 for example?
What you could do is write a Comparator which has an extra property which represents the element in your String array you want to use to sort your List by. Then you could use Collections.sort(List list, Comparator c). [ April 26, 2005: Message edited by: Paul Sturrock ]