Class CharSequences


  • @Deprecated
    public class CharSequences
    extends java.lang.Object
    Deprecated.
    This API is ICU internal only.
    A number of utilities for dealing with CharSequences and related classes. For accessing codepoints with a CharSequence, also see
    • Character.codePointAt(CharSequence, int)
    • Character.codePointBefore(CharSequence, int)
    • Character.codePointCount(CharSequence, int, int)
    • Character.charCount(int)
    • Character.offsetByCodePoints(CharSequence, int, int)
    • Character.toChars(int, char[], int)
    • Character.toCodePoint(char, char)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CharSequences()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int codePointLength​(java.lang.CharSequence s)
      Deprecated.
      This API is ICU internal only.
      static int[] codePoints​(java.lang.CharSequence s)
      Deprecated.
      This API is ICU internal only.
      static int compare​(int codepoint, java.lang.CharSequence a)
      Deprecated.
      This API is ICU internal only.
      static int compare​(java.lang.CharSequence string, int codePoint)
      Deprecated.
      This API is ICU internal only.
      static int compare​(java.lang.CharSequence a, java.lang.CharSequence b)
      Deprecated.
      This API is ICU internal only.
      static boolean equals​(int codepoint, java.lang.CharSequence other)
      Deprecated.
      This API is ICU internal only.
      static boolean equals​(java.lang.CharSequence other, int codepoint)
      Deprecated.
      This API is ICU internal only.
      static <T> boolean equals​(T a, T b)
      Deprecated.
      This API is ICU internal only.
      static boolean equalsChars​(java.lang.CharSequence a, java.lang.CharSequence b)
      Deprecated.
      This API is ICU internal only.
      static int getSingleCodePoint​(java.lang.CharSequence s)
      Deprecated.
      This API is ICU internal only.
      static int indexOf​(java.lang.CharSequence s, int codePoint)
      Deprecated.
      This API is ICU internal only.
      static int matchAfter​(java.lang.CharSequence a, java.lang.CharSequence b, int aIndex, int bIndex)
      Deprecated.
      This API is ICU internal only.
      static boolean onCharacterBoundary​(java.lang.CharSequence s, int i)
      Deprecated.
      This API is ICU internal only.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CharSequences

        private CharSequences()
        Deprecated.
    • Method Detail

      • matchAfter

        @Deprecated
        public static int matchAfter​(java.lang.CharSequence a,
                                     java.lang.CharSequence b,
                                     int aIndex,
                                     int bIndex)
        Deprecated.
        This API is ICU internal only.
        Find the longest n such that a[aIndex,n] = b[bIndex,n], and n is on a character boundary.
      • codePointLength

        @Deprecated
        public int codePointLength​(java.lang.CharSequence s)
        Deprecated.
        This API is ICU internal only.
        Count the code point length. Unpaired surrogates count as 1.
      • equals

        @Deprecated
        public static final boolean equals​(int codepoint,
                                           java.lang.CharSequence other)
        Deprecated.
        This API is ICU internal only.
        Utility function for comparing codepoint to string without generating new string.
      • equals

        @Deprecated
        public static final boolean equals​(java.lang.CharSequence other,
                                           int codepoint)
        Deprecated.
        This API is ICU internal only.
      • compare

        @Deprecated
        public static int compare​(java.lang.CharSequence string,
                                  int codePoint)
        Deprecated.
        This API is ICU internal only.
        Utility to compare a string to a code point. Same results as turning the code point into a string (with the [ugly] new StringBuilder().appendCodePoint(codepoint).toString()) and comparing, but much faster (no object creation). Actually, there is one difference; a null compares as less. Note that this (=String) order is UTF-16 order -- not code point order.
      • compare

        @Deprecated
        public static int compare​(int codepoint,
                                  java.lang.CharSequence a)
        Deprecated.
        This API is ICU internal only.
        Utility to compare a string to a code point. Same results as turning the code point into a string and comparing, but much faster (no object creation). Actually, there is one difference; a null compares as less. Note that this (=String) order is UTF-16 order -- not code point order.
      • getSingleCodePoint

        @Deprecated
        public static int getSingleCodePoint​(java.lang.CharSequence s)
        Deprecated.
        This API is ICU internal only.
        Return the value of the first code point, if the string is exactly one code point. Otherwise return Integer.MAX_VALUE.
      • equals

        @Deprecated
        public static final <T> boolean equals​(T a,
                                               T b)
        Deprecated.
        This API is ICU internal only.
        Utility function for comparing objects that may be null string.
      • compare

        @Deprecated
        public static int compare​(java.lang.CharSequence a,
                                  java.lang.CharSequence b)
        Deprecated.
        This API is ICU internal only.
        Utility for comparing the contents of CharSequences
      • equalsChars

        @Deprecated
        public static boolean equalsChars​(java.lang.CharSequence a,
                                          java.lang.CharSequence b)
        Deprecated.
        This API is ICU internal only.
        Utility for comparing the contents of CharSequences
      • onCharacterBoundary

        @Deprecated
        public static boolean onCharacterBoundary​(java.lang.CharSequence s,
                                                  int i)
        Deprecated.
        This API is ICU internal only.
        Are we on a character boundary?
      • indexOf

        @Deprecated
        public static int indexOf​(java.lang.CharSequence s,
                                  int codePoint)
        Deprecated.
        This API is ICU internal only.
        Find code point in string.
      • codePoints

        @Deprecated
        public static int[] codePoints​(java.lang.CharSequence s)
        Deprecated.
        This API is ICU internal only.
        Utility function for simplified, more robust loops, such as:
           for (int codePoint : CharSequences.codePoints(string)) {
             doSomethingWith(codePoint);
           }