R
Roedy Green
I have been experimenting rewriting code using enums to see how they
differ from the old int style and class style kludged enums.
Enums have a number of rough edges.
1. they are not inner classes, at least I have not yet figured out how
to make them work that way. This means they cannot communicate as
easily with the enclosing class.
2. the syntax of commas and {} gets pretty tenuous when you start
adding custom methods for enum constants and methods for the enum as a
whole. The enum constant names can get lost in the syntactic noise.
3. there are magic pre-constructed methods you cannot override,
equals, valueOf, compareTo.
4. I'm not sure if enum constant methods can override enum as a whole
methods.
5. Enum constructors can't touch static data. Ouch!
oddly, it seems much harder to convert code that was done with enum
classes than enum ints.
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm
Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
differ from the old int style and class style kludged enums.
Enums have a number of rough edges.
1. they are not inner classes, at least I have not yet figured out how
to make them work that way. This means they cannot communicate as
easily with the enclosing class.
2. the syntax of commas and {} gets pretty tenuous when you start
adding custom methods for enum constants and methods for the enum as a
whole. The enum constant names can get lost in the syntactic noise.
3. there are magic pre-constructed methods you cannot override,
equals, valueOf, compareTo.
4. I'm not sure if enum constant methods can override enum as a whole
methods.
5. Enum constructors can't touch static data. Ouch!
oddly, it seems much harder to convert code that was done with enum
classes than enum ints.
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm
Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes