Find maxmimum element of ArrayList with Collections
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nicola_Fontana
Posted On:   Thursday, March 15, 2012 08:10 AM

Hello everyone,

I am trying to find th maximum element of my ArrayList using the collections.max(ArrayList) command. This works fine for a list with single comparable values, however I have in my list which contain three traits (ID, age, weight). How would I find the entry with the maximum age for instance?

Thank you for your help
Nicola

Re: Find maxmimum element of ArrayList with Collections

Posted By:   narsimha  
Posted On:   Sunday, July 1, 2012 11:12 AM

 

 

 

My personal view is that for cards there isn't really a natural order since different games differ in their interpretation of the Ace, so it might be better to avoid assigning "semantics" by offering Comparable as part of the class.    systematicuk.co.uk


narsimhamurthy peddoju

Re: Find maxmimum element of ArrayList with Collections

Posted By:   altonalvin  
Posted On:   Wednesday, June 27, 2012 02:43 AM

My personal view is that for cards there isn't really a natural order since different games differ in their interpretation of the Ace, so it might be better to avoid assigning "semantics" by offering Comparable as part of the class.    systematicuk.co.uk

About | Sitemap | Contact