This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Sorting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sorting problem" Watch "Sorting problem" New topic

Sorting problem

Alex Pol
Ranch Hand

Joined: Sep 29, 2006
Posts: 33
I have a map in which the key is a customerId (a String), and the value is a collection of objects of type T, which have an attribute BigDecimal "value" and another attribute String "manufacturer" which can take 2 values: "manuf1" and "manuf2".

I want to obtain the top 10 of customers, and to display for each the total "value", the value for manuf1 and the value for manuf2 (these are sums of course)

Any ideas are appreciated.

Ravikanth kolli
Ranch Hand

Joined: Feb 10, 2008
Posts: 179

Can you actually be more clear in your question?
Do you mean that each customer is mapped to 2 manufacturers?

I agree. Here's the link:
subject: Sorting problem
Similar Threads
Getting value of Disabled field
getValue() method
type conversions
Obtaining data from form elements
ServletContextListener not working