public class CharUtilities
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static char |
CARRIAGE_RETURN |
carriage return
|
static char |
CODE_EOT |
Character code used to signal a character boundary in
inline content, such as an inline with borders and padding
or a nested block object.
|
static int |
EOT |
Character class: Boundary between text runs
|
static char |
IDEOGRAPHIC_SPACE |
Ideogreaphic space
|
static char |
LINE_SEPARATOR |
line-separator
|
static int |
LINEFEED |
Character class: Line feed
|
static char |
LINEFEED_CHAR |
linefeed character
|
static char |
LRE |
left-to-right embedding
|
static char |
LRM |
left-to-right mark
|
static char |
LRO |
left-to-right override
|
static char |
MISSING_IDEOGRAPH |
missing ideograph
|
static char |
NBSPACE |
non-breaking space
|
static char |
NEXT_LINE |
next line control character
|
static int |
NONWHITESPACE |
Character class: non-whitespace
|
static char |
NOT_A_CHARACTER |
Unicode value indicating the the character is "not a character".
|
static char |
NULL_CHAR |
null char
|
static char |
OBJECT_REPLACEMENT_CHARACTER |
Object replacement character
|
static char |
PARAGRAPH_SEPARATOR |
paragraph-separator
|
static char |
PDF |
pop directional formatting
|
static char |
RLE |
right-to-left embedding
|
static char |
RLM |
right-to-left mark
|
static char |
RLO |
right-to-left override
|
static char |
SOFT_HYPHEN |
soft hyphen
|
static char |
SPACE |
normal space
|
static char |
TAB |
normal tab
|
static int |
UCWHITESPACE |
Character class: Unicode white space
|
static char |
WORD_JOINER |
word joiner
|
static int |
XMLWHITESPACE |
Character class: XML whitespace
|
static char |
ZERO_WIDTH_JOINER |
zero-width joiner
|
static char |
ZERO_WIDTH_NOBREAK_SPACE |
zero-width no-break space (= byte order mark)
|
static char |
ZERO_WIDTH_SPACE |
zero-width space
|
Modifier | Constructor | Description |
---|---|---|
protected |
CharUtilities() |
Utility class: Constructor prevents instantiating when subclassed.
|
Modifier and Type | Method | Description |
---|---|---|
static java.lang.String |
charToNCRef(int c) |
Convert a single unicode scalar value to an XML numeric character
reference.
|
static int |
classOf(int c) |
Return the appropriate CharClass constant for the type
of the passed character.
|
static java.lang.String |
format(int c) |
Format character for debugging output, which it is prefixed with "0x", padded left with '0'
and either 4 or 6 hex characters in width according to whether it is in the BMP or not.
|
static boolean |
isAdjustableSpace(int c) |
Method to determine if the character is an adjustable
space.
|
static boolean |
isAlphabetic(int c) |
Indicates whether a character is classified as "Alphabetic" by the Unicode standard.
|
static boolean |
isAnySpace(int c) |
Determines if the character represents any kind of space.
|
static boolean |
isBreakableSpace(int c) |
Helper method to determine if the character is a
space with normal behavior.
|
static boolean |
isExplicitBreak(int c) |
Indicates whether the given character is an explicit break-character
|
static boolean |
isFixedWidthSpace(int c) |
Method to determine if the character is a (breakable) fixed-width space.
|
static boolean |
isNonBreakableSpace(int c) |
Method to determine if the character is a nonbreaking
space.
|
static boolean |
isSameSequence(java.lang.CharSequence cs1,
java.lang.CharSequence cs2) |
Determine if two character sequences contain the same characters.
|
static boolean |
isZeroWidthSpace(int c) |
Method to determine if the character is a zero-width space.
|
static java.lang.String |
padLeft(java.lang.String s,
int width,
char pad) |
Pad a string S on left out to width W using padding character PAD.
|
static java.lang.String |
toNCRefs(java.lang.String s) |
Convert a string to a sequence of ASCII or XML numeric character references.
|
public static final char CODE_EOT
public static final int UCWHITESPACE
public static final int LINEFEED
public static final int EOT
public static final int NONWHITESPACE
public static final int XMLWHITESPACE
public static final char NULL_CHAR
public static final char LINEFEED_CHAR
public static final char CARRIAGE_RETURN
public static final char TAB
public static final char SPACE
public static final char NBSPACE
public static final char NEXT_LINE
public static final char ZERO_WIDTH_SPACE
public static final char WORD_JOINER
public static final char ZERO_WIDTH_JOINER
public static final char LRM
public static final char RLM
public static final char LRE
public static final char RLE
public static final char PDF
public static final char LRO
public static final char RLO
public static final char ZERO_WIDTH_NOBREAK_SPACE
public static final char SOFT_HYPHEN
public static final char LINE_SEPARATOR
public static final char PARAGRAPH_SEPARATOR
public static final char MISSING_IDEOGRAPH
public static final char IDEOGRAPHIC_SPACE
public static final char OBJECT_REPLACEMENT_CHARACTER
public static final char NOT_A_CHARACTER
protected CharUtilities()
public static int classOf(int c)
c
- character to inspectpublic static boolean isBreakableSpace(int c)
c
- character to inspectpublic static boolean isZeroWidthSpace(int c)
c
- the character to checkpublic static boolean isFixedWidthSpace(int c)
c
- the character to checkpublic static boolean isNonBreakableSpace(int c)
c
- character to checkpublic static boolean isAdjustableSpace(int c)
c
- character to checkpublic static boolean isAnySpace(int c)
c
- character to checkpublic static boolean isAlphabetic(int c)
c
- the characterpublic static boolean isExplicitBreak(int c)
c
- the character to checkpublic static java.lang.String charToNCRef(int c)
c
- a unicode scalar valuepublic static java.lang.String toNCRefs(java.lang.String s)
s
- a java string (encoded in UTF-16)public static java.lang.String padLeft(java.lang.String s, int width, char pad)
s
- string to padwidth
- width of field to add paddingpad
- character to use for paddingpublic static java.lang.String format(int c)
c
- character codepublic static boolean isSameSequence(java.lang.CharSequence cs1, java.lang.CharSequence cs2)
cs1
- first character sequencecs2
- second character sequenceCopyright 1999-2016 The Apache Software Foundation. All Rights Reserved.