writes:
> Why (or when) would one prefer to use 'EnumMap'
> in favor to 'HashMap' ?
Efficiency. EnumMap is a specialized implementation of Map, where
HashMap is very general. Specializing allows using non-general
optimizations. An EnumMap is optimized to hold only enumeration
values, and it doesn't need to, e.g., call hashcode() on the
values.
As enum values can be mapped to small integers, an EnumMap might be
implemented using an array. (Hmm, that's easy to check, the source
code for EnumMap is available. And yes, it uses an array

.
/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'