Dual View Enums

R

Roedy Green

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,371
Latest member
TroyHursey

Latest Threads

Top