APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.icu.impl

public final Class Utility

extends Object
Class Inheritance
Imports
jdk.internal.icu.lang.UCharacter, jdk.internal.icu.text.UTF16, java.io.IOException, java.util.Locale

Field Summary

Modifier and TypeField and Description
pack-priv static final char[]
private static final char[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final String
escape(String s)

Convert characters outside the range U+0020 to U+007F to Unicode escapes, and convert backslash to a double backslash.

public static <T extends Appendable> boolean
escapeUnprintable(T result, int c)

Escape unprintable characters using <backslash>uxxxx notation for U+0000 to U+FFFF and <backslash>Uxxxxxxxx for U+10000 and above.

public static String
hex(long i, int places)

Supplies a zero-padded hex representation of an integer (without 0x)

public static boolean
isUnprintable(int c)

Return true if the character is NOT printable ASCII.

public static int

Returns:

character value from 0 to 10FFFF, or -1 on error.
unescapeAt
(String s, int[]
an array containing offset to the character after the backslash. Upon return offset16[0] will be updated to point after the escape sequence.
offset16
)

Convert an escape to a 32-bit code point value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIGITSback to summary
pack-priv static final char[] DIGITS
UNESCAPE_MAPback to summary
private static final char[] UNESCAPE_MAP

Constructor Detail

Utilityback to summary
public Utility()

Method Detail

escapeback to summary
public static final String escape(String s)

Convert characters outside the range U+0020 to U+007F to Unicode escapes, and convert backslash to a double backslash.

escapeUnprintableback to summary
public static <T extends Appendable> boolean escapeUnprintable(T result, int c)

Escape unprintable characters using <backslash>uxxxx notation for U+0000 to U+FFFF and <backslash>Uxxxxxxxx for U+10000 and above. If the character is printable ASCII, then do nothing and return false. Otherwise, append the escaped notation and return true.

hexback to summary
public static String hex(long i, int places)

Supplies a zero-padded hex representation of an integer (without 0x)

isUnprintableback to summary
public static boolean isUnprintable(int c)

Return true if the character is NOT printable ASCII. The tab, newline and linefeed characters are considered unprintable.

unescapeAtback to summary
public static int unescapeAt(String s, int[] offset16)

Convert an escape to a 32-bit code point value. We attempt to parallel the icu4c unescapeAt() function.

Parameters
offset16:int[]

an array containing offset to the character after the backslash. Upon return offset16[0] will be updated to point after the escape sequence.

Returns:int

character value from 0 to 10FFFF, or -1 on error.