jastrachan | 1 Feb 08:33 2005
Picon

Re: Newbie question about maps


On 31 Jan 2005, at 20:58, Martin C. Martin wrote:
> Jean-Louis Berliet wrote:
>> How to get an ordered list of keys of a map ?
>> In other words, how to obtain the list [2, 5, 10, 20]
>> from the map [10:"bbb", 5:"aaaa", 20:"ddd", 2:"cc"] ?
>
> Try:
>
> [10:"bbb", 5:"aaaa", 20:"ddd", 2:"cc"].keys.sort

Agreed - remember that lists in Groovy are java.util.List and maps in 
Groovy are java.util.Map...

James
-------
http://radio.weblogs.com/0112098/


Gmane