Posted By

kowalskg on 09/05/08


Tagged

groovy


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sfhynx


Exmple of Sorting a Map


 / Published in: Groovy
 

  1. def sortedCount = badSnpsMap.keySet().toList()
  2. sortedCount.sort{ badSnpsMap[it] }
  3.  
  4. println "Bad SNPS count"
  5. println "-------------------------------------------------"
  6. sortedCount.reverse().each { probeSetId ->
  7. println "" << probeSetId << "\t\t" << badSnpsMap[probeSetId]
  8. }
  9.  
  10.  
  11. your: 2for: 1
  12. """
  13. recipes: 1

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: kowalskg on September 5, 2008

Line 2 fields wierd , sorting a value "it" on it's value within another Map ....

You need to login to post a comment.