Class Surrogate

java.lang.Object
com.sun.codemodel.util.Surrogate

class Surrogate extends 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 generation support.
    static class 
    Surrogate parsing support.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
     
    static final char
     
    static final char
     
    static final char
     
    static final char
     
    static final char
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    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
  • Field Details

  • Constructor Details

    • Surrogate

      private Surrogate()
  • Method Details

    • 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.