Class Surrogate


  • class Surrogate
    extends java.lang.Object
    Utility class for dealing with surrogates.
    Version:
    1.11, 03/01/23
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Surrogate.Generator
      Surrogate generation support.
      static class  Surrogate.Parser
      Surrogate parsing support.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Surrogate()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static char high​(int uc)
      Returns the high UTF-16 surrogate for the given UCS-4 character.
      static boolean is​(int c)
      Tells whether or not the given UTF-16 value is a surrogate character,
      static boolean isHigh​(int c)
      Tells whether or not the given UTF-16 value is a high surrogate.
      static boolean isLow​(int c)
      Tells whether or not the given UTF-16 value is a low surrogate.
      static char low​(int uc)
      Returns the low UTF-16 surrogate for the given UCS-4 character.
      static boolean neededFor​(int uc)
      Tells whether or not the given UCS-4 character must be represented as a surrogate pair in UTF-16.
      static int toUCS4​(char c, char d)
      Converts the given surrogate pair into a 32-bit UCS-4 character.
      • Methods inherited from class java.lang.Object

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

      • Surrogate

        private Surrogate()
    • Method Detail

      • isHigh

        public static boolean isHigh​(int c)
        Tells whether or not the given UTF-16 value is a high surrogate.
      • isLow

        public static boolean isLow​(int c)
        Tells whether or not the given UTF-16 value is a low surrogate.
      • is

        public static boolean is​(int c)
        Tells whether or not the given UTF-16 value is a surrogate character,
      • neededFor

        public static boolean neededFor​(int uc)
        Tells whether or not the given UCS-4 character must be represented as a surrogate pair in UTF-16.
      • high

        public static char high​(int uc)
        Returns the high UTF-16 surrogate for the given UCS-4 character.
      • low

        public static char low​(int uc)
        Returns the low UTF-16 surrogate for the given UCS-4 character.
      • toUCS4

        public static int toUCS4​(char c,
                                 char d)
        Converts the given surrogate pair into a 32-bit UCS-4 character.