Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 44406 invoked from network); 11 Mar 2004 10:31:06 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 11 Mar 2004 10:31:06 -0000 Received: (qmail 4233 invoked by uid 500); 11 Mar 2004 10:30:37 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 4083 invoked by uid 500); 11 Mar 2004 10:30:36 -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 4062 invoked from network); 11 Mar 2004 10:30:36 -0000 Received: from unknown (HELO ns0038.seagull.nl) (213.53.115.22) by daedalus.apache.org with SMTP; 11 Mar 2004 10:30:36 -0000 Received: from verify.seagullsoftware.com ([10.1.1.17] RDNS failed) by ns0038.seagull.nl with Microsoft SMTPSVC(6.0.3790.0); Thu, 11 Mar 2004 01:42:32 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [lang] CharUtils.isAscii methods and CharSet, two issues Date: Wed, 10 Mar 2004 19:41:55 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [lang] CharUtils.isAscii methods and CharSet, two issues Thread-Index: AcQGuIQJBvhjQwHjQZC2D8QCgiPUJwARzk3g From: "Gary Gregory" To: "Jakarta Commons Developers List" X-OriginalArrivalTime: 11 Mar 2004 00:42:32.0870 (UTC) FILETIME=[BD7D8C60:01C40701] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, Looking at the new CharUtils class and its isAscii methods and the CharSet class, something feels slightly off. (1) The first thing is that the isAscii* could be implemented in terms of already existing CharSet code.=20 For example, in CharUtils: public static boolean isAsciiAlphaUpper(char ch) { return (ch >=3D 'A' && ch <=3D 'Z'); } Eating our own dog food: public static boolean isAsciiAlphaUpper(char ch) { return CharSet.ASCII_ALPHA_UPPER.contains(ch); } (2) The second item that I am wondering about is the introduction of methods like is{Encoding}SomeCondition(char). This is believe is not OO. One should ask the question to some encoding object, which is what CharSet looks to be for. Would it make sense to improve CharSet with these condition methods such that one could write: CharSet.ASCII.isAlphaUpper(ch) CharSet.ASCII.isWhatever(ch) ? Thank you, Gary --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org