
<?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: Closures</title>
	<atom:link href="http://www.mcdonaldland.info/2008/06/23/closures/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mcdonaldland.info/2008/06/23/closures/</link>
	<description>A magical discussion of software, economics, and other assorted theories.</description>
	<lastBuildDate>Mon, 07 Jun 2010 20:13:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Paul</title>
		<link>http://www.mcdonaldland.info/2008/06/23/closures/comment-page-1/#comment-677</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 23 Jun 2008 17:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.mcdonaldland.info/2008/06/23/closures/#comment-677</guid>
		<description>While not as nice as the language supported closures, commons collections has a closure that can be used with CollectionUtils like so:

CollectionUtils.forAllDo(orig, closure);

or, more relevant to your example a predicate that can be used like:

CollectionUtils.select(orig, predicate);

Of course, they come with the java baggage too (they are objects that must be instantiated, having to cast if you want to pass in something other than what is defined in the interface, etc.).  Hopefully Java will integrate closures into the language someday, they are a great feature.</description>
		<content:encoded><![CDATA[<p>While not as nice as the language supported closures, commons collections has a closure that can be used with CollectionUtils like so:</p>
<p>CollectionUtils.forAllDo(orig, closure);</p>
<p>or, more relevant to your example a predicate that can be used like:</p>
<p>CollectionUtils.select(orig, predicate);</p>
<p>Of course, they come with the java baggage too (they are objects that must be instantiated, having to cast if you want to pass in something other than what is defined in the interface, etc.).  Hopefully Java will integrate closures into the language someday, they are a great feature.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
