Am 02.09.2009 05:21, Martin Buchholz schrieb:


    - I would like to see backwards-referring like:
      public static final int MIN_CODE_POINT = MIN_VALUE;
      public static final int MIN_SUPPLEMENTARY_CODE_POINT = MAX_VALUE
    + 1;


Those would work, but would add to the confusion
between code points and UTF-16 code units.
Notice how "MAX_VALUE + 1" looks like an oxymoron.

;-)
But I don't have any problem as I don't have using Byte.MAX_VALUE + 1.
The real source of the confusion is elsewhere, i.e. imagine we would have class Integer managing 16 + 32 bit values.

Maybe it would become more clear adding MAX_SUPPLEMENTARY_CODE_POINT for *consistency* and having following order: (Note that I added " of type {...@code int}", similar to description of MIN_VALUE.)

   /**
    * The minimum value of a
    * <a href="http://www.unicode.org/glossary/#code_point";>
    * Unicode code point</a>, constant {...@code U+0000}
    * of type {...@code int}.
    *
    * @since 1.5
    */
   public static final int MIN_CODE_POINT = MIN_VALUE;

   /**
    * The minimum value of a
    * <a href="http://www.unicode.org/glossary/#supplementary_code_point";>
    * Unicode supplementary code point</a>, constant {...@code U+10000}
    * of type {...@code int}.
    *
    * @since 1.5
    */
   public static final int MIN_SUPPLEMENTARY_CODE_POINT = MAX_VALUE + 1;

   /**
    * The maximum value of a
    * <a href="http://www.unicode.org/glossary/#code_point";>
    * Unicode code point</a>, constant {...@code U+10FFFF}
    * of type {...@code int}.
    *
    * @since 1.5
    */
   public static final int MAX_CODE_POINT = 0X10FFFF;

   /**
    * The maximum value of a
    * <a href="http://www.unicode.org/glossary/#supplementary_code_point";>
    * Unicode supplementary code point</a>, constant {...@code U+10FFFF}
    * of type {...@code int}.
    *
    * @since 1.7
    */
   public static final int MAX_SUPPLEMENTARY_CODE_POINT = MAX_CODE_POINT;



Having following would be useful too:

   public static final byte MIN_ASCII = MIN_VALUE;
   public static final byte MAX_ASCII = Byte.MAX_VALUE;


-Ulf


Reply via email to