Hello all
I have Arraylist that contains HashMaps
how can I sort the ArrayList by some value of HashMaps?
e.g. I have following HashMaps that are put inside a list and need to sort them by there value
ArrayList<HashMap> al = new ArrayList<HashMap>();
HashMap map1 = new HashMap();
map1.add( new Integer( 2 ), "two" );
map1.add( new Integer( 4 ), "four" );
HashMap map2 = new HashMap();
map2.add( new Integer( 22 ), "two2" );
map2.add( new Integer( 42 ), "four2" );
HashMap map3 = new HashMap();
map3.add( new Integer( 23 ), "two" );
map3.add( new Integer( 43 ), "four" );
al.add(map1);
al.add(map2);
al.add(map3);
Thanks