commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: DBCP/LANG
Date Sun, 11 Aug 2002 21:57:04 GMT
<snip>
> > Sorry, my misunderstanding. As Ola pointed out [rather
> > cryptically] the
> > Enum is from the C meaning and not the Enumeration Java meaning. An
> > ordered set of constant values.
>
> Not necessarily ordered. An Enum of colours, for example, in most cases
> would not have a defined ordering.
>
> > They seem to be a feature often grumbled about not being in
> > Java and often
> > recreated by coders in Java, so a useful Commons feature.
>
> Definitely. The key reason that people create these, I believe, is type
> safety (which is not one of the features of C enums).

Is it some way to implement C style or  type safe C ++ and PASCAL style
enums
in JAVA ? JAVA developers use "final int RED=0x000000FF" and I do not see
any ways to implement something like this :

 enum Color
        {
                     black,
                      red    = 0x000000FF,
                      green = 0x0000FF00,
                      blue   = 0x00FF0000,
                      white = red | green | blue
       };

Is it some "wrappers" ?



> --
> Martin Cooper
>
>
> >
> > Hen
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:commons-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message