TreeMap排序

 

  
  
  
  
  1. ArrayList<Integer> list = new ArrayList<Integer>(); 
  2.         TreeMap<Integer, Integer> tm = Calculate.tjj(0); 
  3.         // 倒序 
  4.         NavigableSet<Integer> descendingKeySet = tm.descendingKeySet(); 
  5.         // 顺序 
  6.         // Set testset = tm.keySet(); 
  7.         Iterator<Integer> it = descendingKeySet.iterator(); 
  8.         while (it.hasNext()) { 
  9.             int key = it.next(); 
  10.             System.out.println("key:" + key); 
  11.             int paramObject = tm.get(key); 
  12.             System.out.println(paramObject); 
  13.             list.add(paramObject); 
  14.         } 

 

你可能感兴趣的:(排序,职场,TreeMap,休闲)