Tuesday, January 26, 2010

Get submap,firstkey , last key from Map(TreeMap)

TreeMap treeMap = new TreeMap();
//get submap from a index to another index
Map subMap = treeMap.subMap(object, object);

//get  firstKey
Object firstKey = treeMap.firstKey();
 //get last key

Object lastKey = treeMap.lastKey();

                       

1 comment:

Anonymous said...

Good one, am looking for this