[jsword-devel] Migration to Java 5
dmsmith555 at yahoo.com
Fri Mar 3 05:36:45 MST 2006
I have just migrated our "typesafe enums" to Java 5 enums.
For an overview see:
Basically our typesafe enums had some or all of the following features:
Comparable, with deterministic ordering
Canonical objects (hashCode, toString, equals, ...)
a name that may differ from the spelling of the enum constant
the ability to derive an enum from
its name or
the string representation of its constant name or
the ordinal position in a global ordering
Dynamic global state
Java 5 enums has most of this. We needed to provide a lookup for its
name and its ordinal position.
It gets rid of a bunch of code.
More information about the jsword-devel