@FunctionalInterface public interface CharMapper
| Modifier and Type | Method and Description |
|---|---|
static String |
arrayMapping(String[] array,
int codePoint,
int base)
Map a range of contiguous code points into strings using an array.
|
static String |
decimalMapping(int codePoint,
String prefix,
String suffix)
Map a code point into a decimal string with prefix and optional suffix.
|
static String |
hexMapping(int codePoint,
int length,
String prefix)
Map a code point into a fixed-length hexadecimal string with prefix and no suffix.
|
static String |
hexMapping(int codePoint,
int length,
String prefix,
String suffix)
Map a code point into a fixed-length hexadecimal string with prefix and optional suffix.
|
static String |
lookupMapping(CharMapperEntry[] table,
int codePoint)
Map a code point using a lookup table.
|
static String |
lookupMapping(String[][] table,
int codePoint)
Map a code point using a lookup table.
|
String |
map(int codePoint)
Map character to it's "escaped" string equivalent, for example '+' to "%2B" in URL
encoding.
|
String map(int codePoint)
null if the character does not need to be converted.codePoint - the Unicode code point of the character to be mappednull if no escape neededstatic String arrayMapping(String[] array, int codePoint, int base)
array - the array of stringscodePoint - the Unicode code pointbase - the code point representing the first entry in the arraynull if the code
point is outside the rangestatic String lookupMapping(String[][] table, int codePoint)
table - an array of mapping entries, each of which is an array of two strings:
a single character string containing the character to be mapped, and the
result stringcodePoint - the Unicode code pointnull if no entry
exists in the table for the code pointstatic String lookupMapping(CharMapperEntry[] table, int codePoint)
table - an array of mapping entries, each of which is an array of two strings:
a single character string containing the character to be mapped, and the
result stringcodePoint - the Unicode code pointnull if no entry
exists in the table for the code pointstatic String decimalMapping(int codePoint, String prefix, String suffix)
codePoint - the Unicode code pointprefix - the prefix stringsuffix - the suffix string (or null if no suffix needed)static String hexMapping(int codePoint, int length, String prefix, String suffix)
codePoint - the Unicode code pointlength - the number of hexadecimal digitsprefix - the prefix stringsuffix - the suffix string (or null if no suffix needed)static String hexMapping(int codePoint, int length, String prefix)
codePoint - the Unicode code pointlength - the number of hexadecimal digitsprefix - the prefix stringCopyright © 2020. All rights reserved.