if i make a map like this:
Map<Object, ArrayList<Object>> multiMap = new HashMap<Object, ArrayList<Object>>();
is there a way for me to sort on the values in the ArrayList<Object>?
i was thinking of just looping through the multimap as such:
for (Entry<Object, ArrayList<Object>> entry : multiMap.entrySet()) {
for (int i = 0; i < entry.size(); i++) {
//retrieve all array items and place in new array to sort
}
so we have object ---> arrayList (contains 2 elements) object ---> arrayList (contains 2 elements) object ---> arrayList (contains 2 elements) object ---> arrayList (contains 2 elements)
i want to take all the elements in all of the arrayLists above and sort by those. it doesn't need to stay in the multimap.. i was just looking to see if there was a better way to do it..
EDIT: the point here is to sort all the array elements in every arrayList against all the other array elements in every other arrayList.... so it's not as simple as just calling sort but i'm wondering if there is a better/cleaner way of doing this? i'm not all that familiar with maps... any help would be appreciated..