The Kaptain on … stuff

Posts Tagged ‘sort

24 Oct, 2009

Groovy reverse map sort done easy

Posted by: TheKaptain In: Development

Sorting a Map by value with Groovy is very simple, due to the added ‘sort’ method on the Map interface. Turns out doing a reverse sort on a Map by values is almost as easy. Using the spaceship operator (‘< =>‘) you can define a very terse syntax for accessing ‘compareTo’, as long as the [...]


Get Adobe Flash playerPlugin by wpburn.com wordpress themes

About

Tales of development, life and the folly that goes along with both.

Tags

On Twitter

Powered by Twitter Tools

profile for TheKaptain at Stack Overflow, Q&A for professional and enthusiast programmers