Class UCharacterUtility

java.lang.Object
com.ibm.icu.impl.UCharacterUtility

public final class UCharacterUtility extends Object
Internal character utility class for simple data type conversion and String parsing functions. Does not have an analog in the JDK.
Since:
sep2900
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    New non character range in Unicode 3.1
    private static final int
    New minimum non character in Unicode 3.1
    private static final int
    Minimum suffix value that indicates if a character is non character.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    private constructor to avoid initialization
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static int
    compareNullTermByteSubString(String str, byte[] array, int strindex, int aindex)
    Compares a null terminated substring from an array of bytes.
    (package private) static int
    getNullTermByteSubString(StringBuffer str, byte[] array, int index)
    Retrieves a null terminated substring from an array of bytes.
    static boolean
    Determines if codepoint is a non character
    (package private) static int
    skipByteSubString(byte[] array, int index, int length, byte skipend)
    skip substrings from an array of characters, where each character is a set of 2 bytes.
    (package private) static int
    skipNullTermByteSubString(byte[] array, int index, int skipcount)
    Skip null terminated substrings from an array of bytes.
    (package private) static int
    toInt(char msc, char lsc)
    joining 2 chars to form an int

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NON_CHARACTER_SUFFIX_MIN_3_0_

      private static final int NON_CHARACTER_SUFFIX_MIN_3_0_
      Minimum suffix value that indicates if a character is non character. Unicode 3.0 non characters
      See Also:
    • NON_CHARACTER_MIN_3_1_

      private static final int NON_CHARACTER_MIN_3_1_
      New minimum non character in Unicode 3.1
      See Also:
    • NON_CHARACTER_MAX_3_1_

      private static final int NON_CHARACTER_MAX_3_1_
      New non character range in Unicode 3.1
      See Also:
  • Constructor Details

    • UCharacterUtility

      private UCharacterUtility()
      private constructor to avoid initialization
  • Method Details

    • isNonCharacter

      public static boolean isNonCharacter(int ch)
      Determines if codepoint is a non character
      Parameters:
      ch - codepoint
      Returns:
      true if codepoint is a non character false otherwise
    • toInt

      static int toInt(char msc, char lsc)
      joining 2 chars to form an int
      Parameters:
      msc - most significant char
      lsc - least significant char
      Returns:
      int form
    • getNullTermByteSubString

      static int getNullTermByteSubString(StringBuffer str, byte[] array, int index)
      Retrieves a null terminated substring from an array of bytes. Substring is a set of non-zero bytes starting from argument start to the next zero byte. If the first byte is a zero, the next byte will be taken as the first byte.
      Parameters:
      str - stringbuffer to store data in, data will be store with each byte as a char
      array - byte array
      index - to start substring in byte count
      Returns:
      the end position of the substring within the character array
    • compareNullTermByteSubString

      static int compareNullTermByteSubString(String str, byte[] array, int strindex, int aindex)
      Compares a null terminated substring from an array of bytes. Substring is a set of non-zero bytes starting from argument start to the next zero byte. if the first byte is a zero, the next byte will be taken as the first byte.
      Parameters:
      str - string to compare
      array - byte array
      strindex - index within str to start comparing
      aindex - array index to start in byte count
      Returns:
      the end position of the substring within str if matches otherwise a -1
    • skipNullTermByteSubString

      static int skipNullTermByteSubString(byte[] array, int index, int skipcount)
      Skip null terminated substrings from an array of bytes. Substring is a set of non-zero bytes starting from argument start to the next zero byte. If the first byte is a zero, the next byte will be taken as the first byte.
      Parameters:
      array - byte array
      index - to start substrings in byte count
      skipcount - number of null terminated substrings to skip
      Returns:
      the end position of the substrings within the character array
    • skipByteSubString

      static int skipByteSubString(byte[] array, int index, int length, byte skipend)
      skip substrings from an array of characters, where each character is a set of 2 bytes. substring is a set of non-zero bytes starting from argument start to the byte of the argument value. skips up to a max number of characters
      Parameters:
      array - byte array to parse
      index - to start substrings in byte count
      length - the max number of bytes to skip
      skipend - value of byte to skip to
      Returns:
      the number of bytes skipped