<?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: Java5: From Ordinal Value To Enum Instance</title>
	<atom:link href="http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/</link>
	<description>About Technology in My Life</description>
	<lastBuildDate>Tue, 24 Jan 2012 17:27:15 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: polesen</title>
		<link>http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/comment-page-1/#comment-35</link>
		<dc:creator>polesen</dc:creator>
		<pubDate>Wed, 06 Feb 2008 08:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/#comment-35</guid>
		<description>@Johann: God dammit, that&#039;s so simple I&#039;m nearly ashamed I missed it :-) Thanks!</description>
		<content:encoded><![CDATA[<p>@Johann: God dammit, that&#8217;s so simple I&#8217;m nearly ashamed I missed it <img src='http://www.techper.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johann Zacharee</title>
		<link>http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/comment-page-1/#comment-33</link>
		<dc:creator>Johann Zacharee</dc:creator>
		<pubDate>Wed, 06 Feb 2008 02:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/2008/02/05/java5-from-ordinal-value-to-enum-instance/#comment-33</guid>
		<description>Why do you need a method?

You can just use Weekday.values[2] and get the same thing.

If you need range safety, create a method that checks the ordinal and then indexes into the values array. No need to build a map.

public static valueOf(int ordinal) {
if (ordinal = values.length) return null;
return values[ordinal];
}</description>
		<content:encoded><![CDATA[<p>Why do you need a method?</p>
<p>You can just use Weekday.values[2] and get the same thing.</p>
<p>If you need range safety, create a method that checks the ordinal and then indexes into the values array. No need to build a map.</p>
<p>public static valueOf(int ordinal) {<br />
if (ordinal = values.length) return null;<br />
return values[ordinal];<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

