Using the new collections from Google's Guava, i was building a Map and adding values as
multimap.put("Date",somestring);
multimap.put("AccountNo",somestring);
multimap.put("Amount",somestring);
multimap.put("Status",somestring);
Now while iterating over the map i wanted to retrieve the values in same order as they were put in map like
12-01-2015 909123423133 2000 004
12-02-2015 909123423134 3000 005
12-03-2015 909123423135 4000 006
12-04-2015 909123423136 5000 007
The way i am iterating retrieves all dates first then all account no , then amounts and finally all statuses .
Iterator itr= ejLogMap.entries().iterator();
//System.out.println("Map Size:"+ejLogMap.size());
while(itr.hasNext()){
Map.Entry pair= (Map.Entry)itr.next();
System.out.println(pair.getKey() + " = " + pair.getValue());
//itr.remove();
}