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. 

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);
    }

(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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to