<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sorting a HashMap by Value in Java vs Ruby</title>
	<atom:link href="http://tommy.chheng.com/index.php/2009/12/sorting-a-hashmap-by-value-in-java-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommy.chheng.com/index.php/2009/12/sorting-a-hashmap-by-value-in-java-ruby/</link>
	<description>All Things Programming!</description>
	<lastBuildDate>Fri, 09 Jul 2010 12:52:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Jim White</title>
		<link>http://tommy.chheng.com/index.php/2009/12/sorting-a-hashmap-by-value-in-java-ruby/comment-page-1/#comment-709</link>
		<dc:creator>Jim White</dc:creator>
		<pubDate>Thu, 11 Feb 2010 00:50:08 +0000</pubDate>
		<guid isPermaLink="false">http://tommy.chheng.com/?p=176#comment-709</guid>
		<description>Groovy is the coolest (i.e., most productive for Java programmers) way to do closures on the JVM.  But your example doesn&#039;t even need a closure:&lt;br&gt;&lt;br&gt;[a:1, b:2, c:1, d:5].keySet().sort()&lt;br&gt;==&gt;&lt;br&gt;[a, b, c, d]&lt;br&gt;&lt;br&gt;But say you wanted something other than the default order:&lt;br&gt;&lt;br&gt;[a:1, b:2, c:1, d:5].keySet().sort { - (it[0] as int) }&lt;br&gt;==&gt;&lt;br&gt;[d, c, b, a]&lt;br&gt;&lt;br&gt;The dandy thing is those are real Java Collections (Collection, List, Set, Map), so that works with a gigantic base of existing Java libraries.</description>
		<content:encoded><![CDATA[<p>Groovy is the coolest (i.e., most productive for Java programmers) way to do closures on the JVM.  But your example doesn&#39;t even need a closure:</p>
<p>[a:1, b:2, c:1, d:5].keySet().sort()<br />==&gt;<br />[a, b, c, d]</p>
<p>But say you wanted something other than the default order:</p>
<p>[a:1, b:2, c:1, d:5].keySet().sort { &#8211; (it[0] as int) }<br />==&gt;<br />[d, c, b, a]</p>
<p>The dandy thing is those are real Java Collections (Collection, List, Set, Map), so that works with a gigantic base of existing Java libraries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe Grand</title>
		<link>http://tommy.chheng.com/index.php/2009/12/sorting-a-hashmap-by-value-in-java-ruby/comment-page-1/#comment-357</link>
		<dc:creator>Christophe Grand</dc:creator>
		<pubDate>Sun, 13 Dec 2009 09:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://tommy.chheng.com/?p=176#comment-357</guid>
		<description>#(x %) is here equivalent to x, so it&#039;s better to write (sort-by x (keys x))</description>
		<content:encoded><![CDATA[<p>#(x %) is here equivalent to x, so it&#8217;s better to write (sort-by x (keys x))</p>
]]></content:encoded>
	</item>
</channel>
</rss>
