commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <>
Subject [lang] CharUtils.isAscii methods and CharSet, two issues
Date Thu, 11 Mar 2004 00:41:55 GMT

Looking at the new CharUtils class and its isAscii methods and the
CharSet class, something feels slightly off.

The first thing is that the isAscii* could be implemented in terms of
already existing CharSet code. 

For example, in CharUtils:

    public static boolean isAsciiAlphaUpper(char ch) {
        return (ch >= 'A' && ch <= 'Z');

Eating our own dog food:

    public static boolean isAsciiAlphaUpper(char ch) {
        return CharSet.ASCII_ALPHA_UPPER.contains(ch);

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:



Thank you,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message