Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 91918 invoked from network); 11 Aug 2002 23:25:58 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 11 Aug 2002 23:25:58 -0000 Received: (qmail 29309 invoked by uid 97); 11 Aug 2002 23:26:26 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 29293 invoked by uid 97); 11 Aug 2002 23:26:26 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 29281 invoked by uid 98); 11 Aug 2002 23:26:26 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <00e201c2418f$33c6f1c0$2a8027d9@oemcomputer> From: "Stephen Colebourne" To: "Jakarta Commons Developers List" References: Subject: Re: DBCP/LANG Date: Mon, 12 Aug 2002 00:31:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Enum (as in C enum) has now been committed to [lang] proper with unit tests. Both ordered and non-ordered enumerated types are supported. Stephen ----- Original Message ----- From: "Henri Yandell" To: "Jakarta Commons Developers List" Sent: Sunday, August 11, 2002 11:15 PM Subject: RE: DBCP/LANG > > If you look in jakarta-commons-sandbox/lang, there is an Enum > implementation in there. > > On Sun, 11 Aug 2002, Martin Cooper wrote: > > > > > > > > -----Original Message----- > > > From: Juozas Baliuka [mailto:baliuka@centras.lt] > > > Sent: Sunday, August 11, 2002 2:57 PM > > > To: Jakarta Commons Developers List > > > Subject: Re: DBCP/LANG > > > > > > > > > > > > > > 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 > > > }; > > > > Sure. Something like this: > > > > public class Color { > > protected int color; > > protected Color(int color) { > > this.color = color; > > } > > public final static Color BLACK = new Color(0); > > public final static Color RED = new Color(0x000000FF); > > ... > > } > > > > Also, Dmitri Plotnikov posted a link here to his implementation last month: > > > > http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=102633830506924&w=2 > > > > -- > > Martin Cooper > > > > > > > > > > Is it some "wrappers" ? > > > > > > > > > > > > > -- > > > > Martin Cooper > > > > > > > > > > > > > > > > > > Hen > > > > > > > > > > > > > > > -- > > > > > To unsubscribe, e-mail: > > > > > > > > For additional commands, e-mail: > > > > > > > > > > > > > > > > > > > > -- > > > > To unsubscribe, e-mail: > > > > > > > For additional commands, e-mail: > > > > > > > > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > > For additional commands, e-mail: > > > > > > > > > > -- > > To unsubscribe, e-mail: > > For additional commands, e-mail: > > > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: