<?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: Tip: Computing the difference of two collections</title>
	<atom:link href="http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/feed/" rel="self" type="application/rss+xml" />
	<link>http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/</link>
	<description>Eclipse Equinox OSGi</description>
	<lastBuildDate>Fri, 03 Feb 2012 14:17:31 +0100</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Elias Volanakis</title>
		<link>http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/comment-page-1/#comment-3034</link>
		<dc:creator>Elias Volanakis</dc:creator>
		<pubDate>Mon, 26 Oct 2009 23:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://eclipsesource.com/blogs/?p=3228#comment-3034</guid>
		<description>Thanks everybody for the comments and snippet.</description>
		<content:encoded><![CDATA[<p>Thanks everybody for the comments and snippet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Hall</title>
		<link>http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/comment-page-1/#comment-3029</link>
		<dc:creator>Matthew Hall</dc:creator>
		<pubDate>Fri, 23 Oct 2009 18:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://eclipsesource.com/blogs/?p=3228#comment-3029</guid>
		<description>You should also check out ListDiff.accept(ListDiffVisitor) which interprets composite changes (i.e. related adds and removes) as moves or replacements.

&lt;pre&gt;
ListDiff diff = Diffs.computeListDiff(before, after);
diff.accept(new ListDiffVisitor() {
    public void handleAdd(int index, Object element) {
      System.out.println(String.format(&quot;\tadded &#039;%s&#039; at %d&quot;, element, index));
    }
    public void handleRemove(int index, Object element) {
      System.out.println(String.format(&quot;\tremoved &#039;%s&#039; at %d&quot;, element, index));
    }
    public void handleMove(int oldIndex, int newIndex, Object element) {
      System.out.println(String.format(&quot;\tmoved &#039;%s&#039; from %d to %d&quot;, element, oldIndex, newIndex));
    }
    public void handleReplace(int index, Object oldElement, Object newElement) {
      System.out.println(String.format(&quot;\treplaced &#039;%s&#039; with &#039;%s&#039; at %d&quot;, oldElement, newElement, index));
    }
  });
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You should also check out ListDiff.accept(ListDiffVisitor) which interprets composite changes (i.e. related adds and removes) as moves or replacements.</p>
<pre>
ListDiff diff = Diffs.computeListDiff(before, after);
diff.accept(new ListDiffVisitor() {
    public void handleAdd(int index, Object element) {
      System.out.println(String.format("\tadded '%s' at %d", element, index));
    }
    public void handleRemove(int index, Object element) {
      System.out.println(String.format("\tremoved '%s' at %d", element, index));
    }
    public void handleMove(int oldIndex, int newIndex, Object element) {
      System.out.println(String.format("\tmoved '%s' from %d to %d", element, oldIndex, newIndex));
    }
    public void handleReplace(int index, Object oldElement, Object newElement) {
      System.out.println(String.format("\treplaced '%s' with '%s' at %d", oldElement, newElement, index));
    }
  });
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: ekke</title>
		<link>http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/comment-page-1/#comment-3022</link>
		<dc:creator>ekke</dc:creator>
		<pubDate>Fri, 23 Oct 2009 06:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://eclipsesource.com/blogs/?p=3228#comment-3022</guid>
		<description>so: thanks EMF ;-)

ekke</description>
		<content:encoded><![CDATA[<p>so: thanks EMF <img src='http://eclipsesource.com/blogs/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>ekke</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Bokowski</title>
		<link>http://eclipsesource.com/blogs/2009/10/23/tip-computing-the-difference-of-two-collections-made-easy/comment-page-1/#comment-3020</link>
		<dc:creator>Boris Bokowski</dc:creator>
		<pubDate>Fri, 23 Oct 2009 01:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://eclipsesource.com/blogs/?p=3228#comment-3020</guid>
		<description>And, thank you EMF, where the code for computing the difference originally came from! :-)

Boris</description>
		<content:encoded><![CDATA[<p>And, thank you EMF, where the code for computing the difference originally came from! <img src='http://eclipsesource.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Boris</p>
]]></content:encoded>
	</item>
</channel>
</rss>

