<?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: The Filter Pattern: Java Conditional Abstraction With Iterables</title>
	<atom:link href="http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/</link>
	<description>Thoughts and photos from an American living in Spain.</description>
	<lastBuildDate>Thu, 18 Mar 2010 19:20:26 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fluminis</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-5639</link>
		<dc:creator>Fluminis</dc:creator>
		<pubDate>Thu, 04 Mar 2010 16:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-5639</guid>
		<description>Yeaaah !, great job, thanks for sharing.

I change your class to filter a tree...
Not so easy but your work help me a lot, thanks again.</description>
		<content:encoded><![CDATA[<p>Yeaaah !, great job, thanks for sharing.</p>
<p>I change your class to filter a tree&#8230;<br />
Not so easy but your work help me a lot, thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik R.</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-5069</link>
		<dc:creator>Erik R.</dc:creator>
		<pubDate>Sun, 04 Oct 2009 19:55:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-5069</guid>
		<description>Yes, that call is valid.  The code I have here does compile, after fixing the one error that Phil pointed out above: The iterable parameter on line 11 must be marked final.

Once I fixed that, I just compiled the class fine.</description>
		<content:encoded><![CDATA[<p>Yes, that call is valid.  The code I have here does compile, after fixing the one error that Phil pointed out above: The iterable parameter on line 11 must be marked final.</p>
<p>Once I fixed that, I just compiled the class fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhijeet</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-5068</link>
		<dc:creator>Abhijeet</dc:creator>
		<pubDate>Sun, 04 Oct 2009 19:44:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-5068</guid>
		<description>Thanks for the informative post.

But I can&#039;t get the base class of your code to compile. 
Your abstract base class Filter contains a private class, the FilterIterator. This FilterIterator has a toNext method, which internally calls the abstract method passes. This is where my code fails to compile.
&quot;The method passes(T) in the type Filter is not applicable for the arguments (T)&quot;
Is it even valid for an abstract method to be invoked this way?
Or have I got my generics all wrong?</description>
		<content:encoded><![CDATA[<p>Thanks for the informative post.</p>
<p>But I can&#8217;t get the base class of your code to compile.<br />
Your abstract base class Filter contains a private class, the FilterIterator. This FilterIterator has a toNext method, which internally calls the abstract method passes. This is where my code fails to compile.<br />
&#8220;The method passes(T) in the type Filter is not applicable for the arguments (T)&#8221;<br />
Is it even valid for an abstract method to be invoked this way?<br />
Or have I got my generics all wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rx</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-4386</link>
		<dc:creator>Rx</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-4386</guid>
		<description>Thanks Erik - the Filter is a very clever and indeed a VERY powerful pattern. Used it to construct complex filters (composite AND/OR, inverters) on different business objects - very handy and powerful especially with code flexibility and reusability in mind.

to Hardwareguy: you really think so? Well, THAT is why youre the HARDWARE guy.</description>
		<content:encoded><![CDATA[<p>Thanks Erik &#8211; the Filter is a very clever and indeed a VERY powerful pattern. Used it to construct complex filters (composite AND/OR, inverters) on different business objects &#8211; very handy and powerful especially with code flexibility and reusability in mind.</p>
<p>to Hardwareguy: you really think so? Well, THAT is why youre the HARDWARE guy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik R.</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-4192</link>
		<dc:creator>Erik R.</dc:creator>
		<pubDate>Fri, 15 May 2009 15:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-4192</guid>
		<description>HG, I guess the two main reasons would be clarity and code reuse.  But I suppose one man&#039;s clarity is another man&#039;s obfuscation.</description>
		<content:encoded><![CDATA[<p>HG, I guess the two main reasons would be clarity and code reuse.  But I suppose one man&#8217;s clarity is another man&#8217;s obfuscation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hardwareguy</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-4191</link>
		<dc:creator>Hardwareguy</dc:creator>
		<pubDate>Thu, 14 May 2009 19:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-4191</guid>
		<description>Should I be the only one to bring up the elephant in the room? The code at the top we&#039;re trying to get rid of is smaller, faster, less error prone, easier to test, more easily readable...I could go on.  Why would you want to implement the filter pattern except as a programming exercise?</description>
		<content:encoded><![CDATA[<p>Should I be the only one to bring up the elephant in the room? The code at the top we&#8217;re trying to get rid of is smaller, faster, less error prone, easier to test, more easily readable&#8230;I could go on.  Why would you want to implement the filter pattern except as a programming exercise?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Young</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-3459</link>
		<dc:creator>Phil Young</dc:creator>
		<pubDate>Thu, 04 Dec 2008 18:54:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-3459</guid>
		<description>Erik, making the parameter final got past the compilation error. The Filter is a very useful concept. Thanks, Phil</description>
		<content:encoded><![CDATA[<p>Erik, making the parameter final got past the compilation error. The Filter is a very useful concept. Thanks, Phil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik R.</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-3456</link>
		<dc:creator>Erik R.</dc:creator>
		<pubDate>Thu, 04 Dec 2008 02:50:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-3456</guid>
		<description>No, Phil, I had not seen that.  But I&#039;m not sure I actually compiled this code either.  It&#039;s meant as an example only.  You probably just need to make the parameter &quot;final&quot;, like the compiler says.  Maybe I left that out for formatting (so it wouldn&#039;t wrap) reasons.  I can&#039;t remember.

The concept is still sound.  I use it every day.</description>
		<content:encoded><![CDATA[<p>No, Phil, I had not seen that.  But I&#8217;m not sure I actually compiled this code either.  It&#8217;s meant as an example only.  You probably just need to make the parameter &#8220;final&#8221;, like the compiler says.  Maybe I left that out for formatting (so it wouldn&#8217;t wrap) reasons.  I can&#8217;t remember.</p>
<p>The concept is still sound.  I use it every day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Young</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-3455</link>
		<dc:creator>Phil Young</dc:creator>
		<pubDate>Wed, 03 Dec 2008 20:33:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-3455</guid>
		<description>Erik,

I attempted to compile your Filter class with JRE 6.0_07 but I got an error here:
public Iterable filter(Iterable iterable) {
    return new Iterable() {
      public Iterator iterator() {
//** next line: &quot;cannot refer to a non-final variable iterator inside an inner class defined in a different method.
        return filter(iterable.iterator());
      }
    };
  }

Have you seen this error?
Thanks, Phil Young, Xerox Corp.</description>
		<content:encoded><![CDATA[<p>Erik,</p>
<p>I attempted to compile your Filter class with JRE 6.0_07 but I got an error here:<br />
public Iterable filter(Iterable iterable) {<br />
    return new Iterable() {<br />
      public Iterator iterator() {<br />
//** next line: &#8220;cannot refer to a non-final variable iterator inside an inner class defined in a different method.<br />
        return filter(iterable.iterator());<br />
      }<br />
    };<br />
  }</p>
<p>Have you seen this error?<br />
Thanks, Phil Young, Xerox Corp.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heather</title>
		<link>http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/comment-page-1/#comment-1811</link>
		<dc:creator>Heather</dc:creator>
		<pubDate>Fri, 18 Jan 2008 23:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2008/01/18/the-filter-pattern-java-conditional-abstraction-with-iterables/#comment-1811</guid>
		<description>I didn&#039;t know it was possible to feel intelligent and mind blowingly dumb at the same time.........</description>
		<content:encoded><![CDATA[<p>I didn&#8217;t know it was possible to feel intelligent and mind blowingly dumb at the same time&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
