Would it not be simpler to always use the same pattern. Lazy-initialize the
Map and other doo-dads.
Gary
-----Original Message-----
From: Sean Rohead [mailto:sean.rohead_at_USA.NET]
Sent: Friday, February 14, 2003 11:24 AM
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: inefficient typesafe enumeration
I've noticed that the implementation of parse(String str) is just a giant
sequence of if-statements. This seems horribly inefficient when the set of
values in the enumeration is large. Would it be possible to implement this
using a statically initialized HashMap when there are more than a dozen or
so entries?