<?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"
	>
<channel>
	<title>Comments on: Java wish: A Reversible Enum</title>
	<atom:link href="http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/</link>
	<description>Computers are useless. They can only give you answers.</description>
	<pubDate>Tue, 06 Jan 2009 21:18:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Atif Khan&#8217;s Blog &#187; Blog Archive &#187; Multi-valued Reversible enum in Java</title>
		<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-222</link>
		<dc:creator>Atif Khan&#8217;s Blog &#187; Blog Archive &#187; Multi-valued Reversible enum in Java</dc:creator>
		<pubDate>Mon, 16 Apr 2007 23:48:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-222</guid>
		<description>[...] Sometime back I proposed a reversible enum pattern in my post. One thing missing from that implementation was the ability to successfully lookup the enum constants in cases where enum constants can have multiple values. To accomplish this, I utilized another feature introduced in Java 5, namely varargs or variable argument support. This way while building the key for the map, we utilize all the values for a constant and use the varargs in the reverse() method of the enum. [...]</description>
		<content:encoded><![CDATA[<p>[...] Sometime back I proposed a reversible enum pattern in my post. One thing missing from that implementation was the ability to successfully lookup the enum constants in cases where enum constants can have multiple values. To accomplish this, I utilized another feature introduced in Java 5, namely varargs or variable argument support. This way while building the key for the map, we utilize all the values for a constant and use the varargs in the reverse() method of the enum. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atif Khan</title>
		<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-218</link>
		<dc:creator>Atif Khan</dc:creator>
		<pubDate>Fri, 13 Apr 2007 23:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-218</guid>
		<description>No. I am not.</description>
		<content:encoded><![CDATA[<p>No. I am not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-203</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Mon, 09 Apr 2007 20:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-203</guid>
		<description>Hi,

I was wondering if you (Atif Khan) are a student at Parrswood High Scool Y10.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I was wondering if you (Atif Khan) are a student at Parrswood High Scool Y10.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Murray</title>
		<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-46</link>
		<dc:creator>Paul Murray</dc:creator>
		<pubDate>Fri, 08 Dec 2006 01:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-46</guid>
		<description>You know, I would very much like it if java accepted unicode ‹ › for generics. I would also like it if it accepted unicode « » for annotations.

«Transient»
«AttributeOverride name="foo", column=«Column nullable=false»»
class SomeEntity {
...
}

Oh - also, I would like it if java.lang.Math had a constant with the identifier π for the value Pi (in addition to the current constant named PI).

But it just ain't going to happen.

If you use an IDE that allows your source to be UTF-8 encoded, you can use greek θ and φ for variable names in your math-related progams.</description>
		<content:encoded><![CDATA[<p>You know, I would very much like it if java accepted unicode ‹ › for generics. I would also like it if it accepted unicode « » for annotations.</p>
<p>«Transient»<br />
«AttributeOverride name=&#8221;foo&#8221;, column=«Column nullable=false»»<br />
class SomeEntity {<br />
&#8230;<br />
}</p>
<p>Oh - also, I would like it if java.lang.Math had a constant with the identifier π for the value Pi (in addition to the current constant named PI).</p>
<p>But it just ain&#8217;t going to happen.</p>
<p>If you use an IDE that allows your source to be UTF-8 encoded, you can use greek θ and φ for variable names in your math-related progams.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Murray</title>
		<link>http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-45</link>
		<dc:creator>Paul Murray</dc:creator>
		<pubDate>Fri, 08 Dec 2006 01:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.khanspot.com/2006/12/04/java-wish-a-reversible-enum/#comment-45</guid>
		<description>Arrgh! The thingo stripped out the angle brackets! Let's try it again. Sorry if this does not post correctly this time either:

class Foo
{
  static ‹E extends Enum &#38; Valued›
  E getEnum (Class‹E› clazz, Object value)
  {
    for(E e: EnumSet.allOf(clazz)) {
      if(e.getValue().equals(value)) {
        return e;
      }
    }
    return null;
  }
}</description>
		<content:encoded><![CDATA[<p>Arrgh! The thingo stripped out the angle brackets! Let&#8217;s try it again. Sorry if this does not post correctly this time either:</p>
<p>class Foo<br />
{<br />
  static ‹E extends Enum &amp; Valued›<br />
  E getEnum (Class‹E› clazz, Object value)<br />
  {<br />
    for(E e: EnumSet.allOf(clazz)) {<br />
      if(e.getValue().equals(value)) {<br />
        return e;<br />
      }<br />
    }<br />
    return null;<br />
  }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
