Class UnicodeString

java.lang.Object
com.yahoo.text.UnicodeString

public class UnicodeString extends Object
A string wrapper with some convenience methods for dealing with UTF-16 surrogate pairs (a crime against humanity).
Author:
bratseth
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    codePointAt(int index)
     
    int
    Returns the number of code points in this
    boolean
     
    int
     
    int
    Returns the number of positions (not code points) in this
    int
    nextCodePoint(int index)
    Returns the code point at the next position after the given index, or if the index is at the last code point
    int
    nextIndex(int index)
    Returns the index of the next code point after the given index (which may be past the end of the string)
    int
    skip(int codePointCount, int start)
    Returns the position count code points after start (which may be past the end of the string)
    substring(int start, int codePoints)
    Substring in code point space
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UnicodeString

      public UnicodeString(String s)
  • Method Details

    • substring

      public UnicodeString substring(int start, int codePoints)
      Substring in code point space
    • skip

      public int skip(int codePointCount, int start)
      Returns the position count code points after start (which may be past the end of the string)
    • nextIndex

      public int nextIndex(int index)
      Returns the index of the next code point after the given index (which may be past the end of the string)
    • nextCodePoint

      public int nextCodePoint(int index)
      Returns the code point at the next position after the given index, or if the index is at the last code point
    • length

      public int length()
      Returns the number of positions (not code points) in this
    • codePointCount

      public int codePointCount()
      Returns the number of code points in this
    • codePointAt

      public int codePointAt(int index)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object