[prev in list] [next in list] [prev in thread] [next in thread] 

List:       icu
Subject:    ICU4J Proposal to add non-binary Unicode properties APIs
From:       "syn wee" <syn.wee.quek () jtcsv ! com>
Date:       2002-10-09 22:15:28
[Download RAW message or body]

Proposal to add ICU4J APIs for non-binary Unicode properties, similar to the
ICU4C version.
Expiration: Wednesday 23rd October 2002.

For background information about the ICU4C non-binary Unicode property APIs,
please refer to the proposal at the link
http://oss.software.ibm.com/pipermail/icu/2002-June/005069.html.

1) Additional non-binary properties type defined below to be added to the
   class com.ibm.icu.lang.UProperty.
     public static final int UProperty.INT_START
     public static final int UProperty.BIDI_CLASS
     public static final int UProperty.BLOCK
     public static final int UProperty.CANONICAL_COMBINING_CLASS
     public static final int UProperty.DECOMPOSITION_TYPE
     public static final int UProperty.EAST_ASIAN_WIDTH
     public static final int UProperty.GENERAL_CATEGORY
     public static final int UProperty.JOINING_GROUP
     public static final int UProperty.JOINING_TYPE
     public static final int UProperty.LINE_BREAK
     public static final int UProperty.NUMERIC_TYPE
     public static final int UProperty.SCRIPT
     public static final int UProperty.INT_LIMIT

2) There will be 6 public interfaces added to the class
     com.ibm.icu.lang.UCharacter for the non-binary property values.
     UCharacter.DecompositionType,
     UCharacter.EastAsianWidth,
     UCharacter.JoiningGroup,
     UCharacter.JoiningType,
     UCharacter.LineBreak
     and UCharacter.NumericType.

     Each of these interfaces correspond to the enums defined in ICU4C.
     For instance, UCharacter.EastAsianWidth will
     have an ICU4C counterpart UEastAsianWidthCode, and the static final
     member UCharacter. EastAsianWidth.NEUTRAL will have an ICU4C
     counterpart U_EA_NEUTRAL.

3) A new class com.ibm.icu.lang.UCharacter.UnicodeBlock will be added.
     This class follows the syntax of java.lang.Character.UnicodeBlock
     with Unicode 3.2 updated block properties. It extends the Java class,
     java.lang.Character.Subset. Each UnicodeBlock has a name, which is
     the name of the Block it represents, and this name stored as a string
     internally can be retrieved by calling the API toString().
     There are 2 types of data members in UCharacter.UnicodeBlock,

     * static final UnicodeBlock data members, which follows what Java has.
       Example public static final UCharacter.UnicodeBlock DEVANAGARI.
       Calling DEVANAGARI.toString() will return "DEVANAGARI".

     * static final int data members, which corresponds to ICU4C's U_Block
       enums. Example public static final int DEVANAGARI_ID

     This class will contain 3 methods

     * public static UCharacter.UnicodeBlock getInstance(int id)
       allows getting a UnicodeBlock from its identifier

     * public static UCharacter.UnicodeBlock of(int ch),gets the
       UnicodeBlock containing the code point passed in.
       This is a Java API.

     * public int getID(), is a method used on a UnicodeBlock to retrieve
       its corresponding int identifier.

4) 3 new methods will be added to com.ibm.icu.lang.UCharacter.

     * public static int getIntPropertyValue(int c, int which);
     Returns integer values for the property type (argument "which")
     of the code point c.
     For example, getIntPropertyValue(0x20, UProperty.NUMERIC_TYPE) will
     return an integer UCharacter.NumericType.NONE.
     This function will also work with binary properties, returning 0 for
     false and 1 for true.
     boolean b = UCharacter.getIntPropertyValue(c, UProperty.IDEOGRAPHIC);
     // same as b = UCharacter.hasBinaryProperty(UProperty.IDEOGRAPHIC);
     The default return value for an undefined property type is 0.

     * 2 other methods to retrieve the maximum and minimum property
       values for all Unicode code points
       public static int getIntPropertyMinValue(UProperty which);
       public static int getIntPropertyMaxValue(UProperty which);
       For undefined UProperty property types, both minimum, maximum
       values will be 0.

_______________________________________________
icu mailing list
icu@oss.software.ibm.com
http://oss.software.ibm.com/developerworks/oss/mailman/listinfo/icu
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic