Class UCaseProps


  • public final class UCaseProps
    extends Object
    • Field Detail

      • MAX_STRING_LENGTH

        public static final int MAX_STRING_LENGTH
        For string case mappings, a single character (a code point) is mapped either to itself (in which case in-place mapping functions do nothing), or to another single code point, or to a string. Aside from the string contents, these are indicated with a single int value as follows: Mapping to self: Negative values (~self instead of -self to support U+0000) Mapping to another code point: Positive values >MAX_STRING_LENGTH Mapping to a string: The string length (0..MAX_STRING_LENGTH) is returned. Note that the string result may indeed have zero length.
        See Also:
        Constant Field Values
      • dummyStringBuilder

        public static final StringBuilder dummyStringBuilder
      • INSTANCE

        public static final UCaseProps INSTANCE
    • Method Detail

      • addPropertyStarts

        public final void addPropertyStarts​(UnicodeSet set)
      • tolower

        public final int tolower​(int c)
      • toupper

        public final int toupper​(int c)
      • totitle

        public final int totitle​(int c)
      • addCaseClosure

        public final void addCaseClosure​(int c,
                                         UnicodeSet set)
        Adds all simple case mappings and the full case folding for c to sa, and also adds special case closure mappings. c itself is not added. For example, the mappings - for s include long s - for sharp s include ss - for k include the Kelvin sign
      • addStringCaseClosure

        public final boolean addStringCaseClosure​(String s,
                                                  UnicodeSet set)
        Maps the string to single code points and adds the associated case closure mappings. The string is mapped to code points if it is their full case folding string. In other words, this performs a reverse full case folding and then adds the case closure items of the resulting code points. If the string is found and its closure applied, then the string itself is added as well as part of its code points' closure.
        Returns:
        true if the string was found
      • getType

        public final int getType​(int c)
        Returns:
        NONE, LOWER, UPPER, TITLE
      • getTypeOrIgnorable

        public final int getTypeOrIgnorable​(int c)
        Returns:
        same as ucase_getType() and set bit 2 if c is case-ignorable
      • getDotType

        public final int getDotType​(int c)
        Returns:
        NO_DOT, SOFT_DOTTED, ABOVE, OTHER_ACCENT
      • isSoftDotted

        public final boolean isSoftDotted​(int c)
      • isCaseSensitive

        public final boolean isCaseSensitive​(int c)
      • toFullLower

        public final int toFullLower​(int c,
                                     UCaseProps.ContextIterator iter,
                                     StringBuilder out,
                                     ULocale locale,
                                     int[] locCache)
        Get the full lowercase mapping for c.
        Parameters:
        c - Character to be mapped.
        iter - Character iterator, used for context-sensitive mappings. See ContextIterator for details. If iter==null then a context-independent result is returned.
        out - If the mapping result is a string, then it is appended to out.
        locale - Locale ID for locale-dependent mappings.
        locCache - Initialize locCache[0] to 0; may be used to cache the result of parsing the locale ID for subsequent calls. Can be null.
        Returns:
        Output code point or string length, see MAX_STRING_LENGTH.
        See Also:
        UCaseProps.ContextIterator, MAX_STRING_LENGTH
      • fold

        public final int fold​(int c,
                              int options)
      • toFullFolding

        public final int toFullFolding​(int c,
                                       StringBuilder out,
                                       int options)
      • hasBinaryProperty

        public final boolean hasBinaryProperty​(int c,
                                               int which)