Can you change HashMap to TreeMap and try using a compareTo() method like below?
Joined: May 27, 2010
Here we go!!!
The esssential bit are something this way. the method receives an array list. Each object in the list is an array. So a multi dimensional array if you will. Now each row in this multidimensional defines certain attributes. Requirement is to group all those guys with the same column values together in a key value sort of relationship. My key shall be a pojo over those grouping column values. The value is a list of all those objects that share the same column values.
Thanks. I will try it out the tree thing meanwhile.
Oops i goofed up with the comparable equalsTo. == and .equals error. It works now.
But could you explain the difference. The HashMap containsKey() api says the .equals method is invoked to determine if the key is contained. But the overriden .equals of my key object was never called? What am i missing?