I want to know if my HashMap
collection will be always on the same order
Map<Integer, Long> map = new HashMap<Integer, Long>(0);
for(Integer key : users) {
map.put( key , (long) 0 );
}
for( ... ){
...
if( ... ) ){
map.put( t.get(key) , map.get(key) + 1);
}
}
I send this collection to javascript
with ajax
$.each( jsonData[i].totalMap , function(key, value) {
rows.push(value);
});
will have always the same order of the element of the Map
as i put them in my controller ?