dcsimg
Sort algorithm on an ArrayList
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anup_Darvatkar
Posted On:   Friday, July 20, 2001 01:31 AM

Hi,

We need to sort an ArrayList which has user defined objects. The sorting is to be done on one of the fields in the user defined object.

Eg.
The ArrayList consists of user defined ResultData objects.
The ResultData objects has attributes Date, Station,Country, Region.
The sorting is to be done on Country field.

Which approach for sorting such a data will be the most efficient and fastest in java.

Please reply to my id.

Regards,
Anup

Re: Sort algorithm on an ArrayList

Posted By:   Luigi_Viggiano  
Posted On:   Friday, July 20, 2001 03:15 AM

Check java.util.Collections.sort(List) and java.lang.Comparable interface; you'll find the best solution.
About | Sitemap | Contact