<?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: in_array() and implode() for Java</title>
	<atom:link href="http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/</link>
	<description>Coding snippets, tutorials and procrastinations about C#, Java and Linux.</description>
	<lastBuildDate>Mon, 28 Jun 2010 09:06:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Programming Tips : Comparing a Variable to a Number of Values &#124; Ganda Manurung</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-6075</link>
		<dc:creator>Programming Tips : Comparing a Variable to a Number of Values &#124; Ganda Manurung</dc:creator>
		<pubDate>Mon, 28 Jun 2010 09:06:40 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-6075</guid>
		<description>[...] in other programming language if the language doesn&#8217;t have similar function. Here is an in_array() implementation for Java. In Java, you could use any List Object such as ArrayList, Vector, HashMap or other. For C [...]</description>
		<content:encoded><![CDATA[<p>[...] in other programming language if the language doesn&#8217;t have similar function. Here is an in_array() implementation for Java. In Java, you could use any List Object such as ArrayList, Vector, HashMap or other. For C [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Echilon</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-5784</link>
		<dc:creator>Echilon</dc:creator>
		<pubDate>Tue, 15 Sep 2009 09:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-5784</guid>
		<description>Probably, I was new to Java when I posted this.</description>
		<content:encoded><![CDATA[<p>Probably, I was new to Java when I posted this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fajar</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-5782</link>
		<dc:creator>fajar</dc:creator>
		<pubDate>Tue, 15 Sep 2009 07:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-5782</guid>
		<description>you can use contains method for in_array equivalent. http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html#contains(java.lang.Object)</description>
		<content:encoded><![CDATA[<p>you can use contains method for in_array equivalent. <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html#contains(java.lang.Object)">http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html#contains(java.lang.Object)</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Echilon</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-5206</link>
		<dc:creator>Echilon</dc:creator>
		<pubDate>Wed, 25 Mar 2009 20:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-5206</guid>
		<description>The problem with sorting first is that you need to loop over the array twice. You might not need it sorted.</description>
		<content:encoded><![CDATA[<p>The problem with sorting first is that you need to loop over the array twice. You might not need it sorted.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramesh Thiruchelvam</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-5194</link>
		<dc:creator>Ramesh Thiruchelvam</dc:creator>
		<pubDate>Wed, 25 Mar 2009 05:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-5194</guid>
		<description>Java has built in functionality to search arrays using &quot;Arrays.binarySearch&quot;, but only drawback is that the array needs be sorted before it&#039;s searched.

&lt;code&gt;
public static boolean in_array(Object needle, Object[] haystack) {
  Arrays.sort(haystack);
  return (Arrays.binarySearch(haystack, needle) &gt;= 0);
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Java has built in functionality to search arrays using &#8220;Arrays.binarySearch&#8221;, but only drawback is that the array needs be sorted before it&#8217;s searched.</p>
<p><code><br />
public static boolean in_array(Object needle, Object[] haystack) {<br />
  Arrays.sort(haystack);<br />
  return (Arrays.binarySearch(haystack, needle) &gt;= 0);<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rgfdg</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-4449</link>
		<dc:creator>rgfdg</dc:creator>
		<pubDate>Fri, 10 Oct 2008 05:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-4449</guid>
		<description>You should use the StringBuilder in your implode method.</description>
		<content:encoded><![CDATA[<p>You should use the StringBuilder in your implode method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: milo</title>
		<link>http://www.leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/comment-page-1/#comment-4434</link>
		<dc:creator>milo</dc:creator>
		<pubDate>Thu, 25 Sep 2008 12:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/#comment-4434</guid>
		<description>super!!!! Really help a lot!!!</description>
		<content:encoded><![CDATA[<p>super!!!! Really help a lot!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
