Class CharSequences


  • @Deprecated
    public final class CharSequences
    extends java.lang.Object
    Deprecated.
    This class is deprecated and will be removed in a future release. For a replacement, see CharSequences.
    Provides factory methods for creating CharSequence implementations.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static boolean contentEquals​(java.lang.CharSequence a, java.lang.CharSequence b)
      Deprecated.
      Returns true if the content of both CharSequence's are equals.
      static boolean contentEqualsIgnoreCase​(java.lang.CharSequence a, java.lang.CharSequence b)
      Deprecated.
      Perform a case-insensitive comparison of two CharSequences.
      static java.lang.CharSequence emptyAsciiString()
      Deprecated.
      Get a reference to an unmodifiable empty CharSequence with the same properties as newAsciiString(Buffer).
      static int indexOf​(java.lang.CharSequence sequence, char c, int fromIndex)
      Deprecated.
      Find the index of c within sequence starting at index fromIndex.
      static boolean isAsciiString​(java.lang.CharSequence sequence)
      Deprecated.
      Check if the provided CharSequence is an AsciiString, result of a call to newAsciiString(String).
      static java.lang.CharSequence newAsciiString​(Buffer input)
      Deprecated.
      Create a new CharSequence from the specified input, supporting only 8-bit ASCII characters, and with a case-insensitive hashCode.
      static java.lang.CharSequence newAsciiString​(java.lang.String input)
      Deprecated.
      Create a new CharSequence from the specified input, supporting only 8-bit ASCII characters, and with a case-insensitive hashCode.
      static boolean regionMatches​(java.lang.CharSequence cs, boolean ignoreCase, int csStart, java.lang.CharSequence string, int start, int length)
      Deprecated.
      This methods make regionMatches operation correctly for any chars in strings.
      static java.util.List<java.lang.CharSequence> split​(java.lang.CharSequence input, char delimiter)
      Deprecated.
      Split a given CharSequence to separate ones on the given delimiter.
      static Buffer unwrapBuffer​(java.lang.CharSequence cs)
      Deprecated.
      Attempt to unwrap a CharSequence and obtain the underlying Buffer if possible.
      • Methods inherited from class java.lang.Object

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

      • newAsciiString

        public static java.lang.CharSequence newAsciiString​(java.lang.String input)
        Deprecated.
        Create a new CharSequence from the specified input, supporting only 8-bit ASCII characters, and with a case-insensitive hashCode.
        Parameters:
        input - a string containing only 8-bit ASCII characters.
        Returns:
        a CharSequence
      • newAsciiString

        public static java.lang.CharSequence newAsciiString​(Buffer input)
        Deprecated.
        Create a new CharSequence from the specified input, supporting only 8-bit ASCII characters, and with a case-insensitive hashCode.
        Parameters:
        input - a Buffer containing
        Returns:
        a CharSequence.
      • emptyAsciiString

        public static java.lang.CharSequence emptyAsciiString()
        Deprecated.
        Get a reference to an unmodifiable empty CharSequence with the same properties as newAsciiString(Buffer).
        Returns:
        a reference to an unmodifiable empty CharSequence with the same properties as newAsciiString(Buffer).
      • isAsciiString

        public static boolean isAsciiString​(java.lang.CharSequence sequence)
        Deprecated.
        Check if the provided CharSequence is an AsciiString, result of a call to newAsciiString(String).
        Parameters:
        sequence - The CharSequence to check.
        Returns:
        true if the check passes.
      • unwrapBuffer

        @Nullable
        public static Buffer unwrapBuffer​(java.lang.CharSequence cs)
        Deprecated.
        Attempt to unwrap a CharSequence and obtain the underlying Buffer if possible.
        Parameters:
        cs - the CharSequence to unwrap.
        Returns:
        the underlying Buffer or null.
      • contentEqualsIgnoreCase

        public static boolean contentEqualsIgnoreCase​(@Nullable
                                                      java.lang.CharSequence a,
                                                      @Nullable
                                                      java.lang.CharSequence b)
        Deprecated.
        Perform a case-insensitive comparison of two CharSequences.

        NOTE: This only supports 8-bit ASCII.

        Parameters:
        a - first CharSequence to compare.
        b - second CharSequence to compare.
        Returns:
        true if both CharSequence's are equals when ignoring the case.
      • contentEquals

        public static boolean contentEquals​(java.lang.CharSequence a,
                                            java.lang.CharSequence b)
        Deprecated.
        Returns true if the content of both CharSequence's are equals. This only supports 8-bit ASCII.
        Parameters:
        a - left hand side of comparison.
        b - right hand side of comparison.
        Returns:
        true if a's content equals b.
      • indexOf

        public static int indexOf​(java.lang.CharSequence sequence,
                                  char c,
                                  int fromIndex)
        Deprecated.
        Find the index of c within sequence starting at index fromIndex.
        Parameters:
        sequence - The CharSequence to search in.
        c - The character to find.
        fromIndex - The index to start searching (inclusive).
        Returns:
        The index of c or -1 otherwise.
      • split

        public static java.util.List<java.lang.CharSequence> split​(java.lang.CharSequence input,
                                                                   char delimiter)
        Deprecated.
        Split a given CharSequence to separate ones on the given delimiter. The returned CharSequences are created by invoking the CharSequence.subSequence(int, int) method on the main one. This method has no support for regex.
        Parameters:
        input - The initial CharSequence to split, this experiences no side effects
        delimiter - The delimiter character
        Returns:
        a List of CharSequence subsequences of the input with the separated values
      • regionMatches

        public static boolean regionMatches​(java.lang.CharSequence cs,
                                            boolean ignoreCase,
                                            int csStart,
                                            java.lang.CharSequence string,
                                            int start,
                                            int length)
        Deprecated.
        This methods make regionMatches operation correctly for any chars in strings.
        Parameters:
        cs - the CharSequence to be processed
        ignoreCase - specifies if case should be ignored.
        csStart - the starting offset in the cs CharSequence
        string - the CharSequence to compare.
        start - the starting offset in the specified string.
        length - the number of characters to compare.
        Returns:
        true if the ranges of characters are equal, false otherwise.