Dual View Enums
- From: Roedy Green <look-on@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 16:03:21 GMT
I am greatly enjoying Java 1.5 enums, especially the clean
easy-to-read foreach.
This sort of code:
boolean hasJar ( AppCat type )
{
switch (.type )
{
default:
case APPLET:
case HYBRID:
case APPLICATION:
case LIBRARY:
case JWS:
return true;
case DOCUMENTATION:
case SERVLET:
case UTILITY:
return false;
}
}
collapses to:
/* jar desc */
APPLET( true, "xxxx" );
HYBRID( true, "yyyy" );
You still get a bird's eye view, but you also get a birds eye view of
each enum, in a nice grid, so you can compare both by column and by
row.
This is something I was hoping for in a scid, never dreaming I would
get to see both views at once.
--
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
.
- Prev by Date: Re: Html download challenge
- Next by Date: Re: In praise of Java 1.5 enums
- Previous by thread: In praise of Java 1.5 enums
- Next by thread: JSP response.sendRedirect and jsp:forward not working
- Index(es):