File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
It's not a secret anymore!