I am sorry to post this fairly simple piece of code here but I usually forget how to iterate a Map so I wire it here not to forget it again:
Iterator it = themap.entrySet().iterator();
while (it.hasNext()) {
Map.Entry pairs = (Map.Entry)it.next();
pairs.getKey();
pairs.getValue();
}