Character (Java SE 23 & JDK 23)
-
Nested Class Summary
Nested Classes
static classInstances of this class represent particular subsets of the Unicode character set.
static final classA family of character subsets representing the character blocks in the Unicode specification.
static enum -
Field Summary
Fields
static final intThe number of bytes used to represent a
charvalue in unsigned binary form.static final byteGeneral category "Mc" in the Unicode specification.
static final byteGeneral category "Pc" in the Unicode specification.
static final byteGeneral category "Cc" in the Unicode specification.
static final byteGeneral category "Sc" in the Unicode specification.
static final byteGeneral category "Pd" in the Unicode specification.
static final byteGeneral category "Nd" in the Unicode specification.
static final byteWeak bidirectional character type "AN" in the Unicode specification.
static final byteWeak bidirectional character type "BN" in the Unicode specification.
static final byteWeak bidirectional character type "CS" in the Unicode specification.
static final byteWeak bidirectional character type "EN" in the Unicode specification.
static final byteWeak bidirectional character type "ES" in the Unicode specification.
static final byteWeak bidirectional character type "ET" in the Unicode specification.
static final byteWeak bidirectional character type "FSI" in the Unicode specification.
static final byteStrong bidirectional character type "L" in the Unicode specification.
static final byteStrong bidirectional character type "LRE" in the Unicode specification.
static final byteWeak bidirectional character type "LRI" in the Unicode specification.
static final byteStrong bidirectional character type "LRO" in the Unicode specification.
static final byteWeak bidirectional character type "NSM" in the Unicode specification.
static final byteNeutral bidirectional character type "ON" in the Unicode specification.
static final byteNeutral bidirectional character type "B" in the Unicode specification.
static final byteWeak bidirectional character type "PDF" in the Unicode specification.
static final byteWeak bidirectional character type "PDI" in the Unicode specification.
static final byteStrong bidirectional character type "R" in the Unicode specification.
static final byteStrong bidirectional character type "AL" in the Unicode specification.
static final byteStrong bidirectional character type "RLE" in the Unicode specification.
static final byteWeak bidirectional character type "RLI" in the Unicode specification.
static final byteStrong bidirectional character type "RLO" in the Unicode specification.
static final byteNeutral bidirectional character type "S" in the Unicode specification.
static final byteUndefined bidirectional character type.
static final byteNeutral bidirectional character type "WS" in the Unicode specification.
static final byteGeneral category "Me" in the Unicode specification.
static final byteGeneral category "Pe" in the Unicode specification.
static final byteGeneral category "Pf" in the Unicode specification.
static final byteGeneral category "Cf" in the Unicode specification.
static final byteGeneral category "Pi" in the Unicode specification.
static final byteGeneral category "Nl" in the Unicode specification.
static final byteGeneral category "Zl" in the Unicode specification.
static final byteGeneral category "Ll" in the Unicode specification.
static final byteGeneral category "Sm" in the Unicode specification.
static final intstatic final charstatic final charstatic final intThe maximum radix available for conversion to and from strings.
static final charThe maximum value of a Unicode surrogate code unit in the UTF-16 encoding, constant
'\uDFFF'.static final charThe constant value of this field is the largest value of type
char,'\uFFFF'.static final intstatic final charstatic final charstatic final intThe minimum radix available for conversion to and from strings.
static final intstatic final charThe minimum value of a Unicode surrogate code unit in the UTF-16 encoding, constant
'\uD800'.static final charThe constant value of this field is the smallest value of type
char,'\u0000'.static final byteGeneral category "Lm" in the Unicode specification.
static final byteGeneral category "Sk" in the Unicode specification.
static final byteGeneral category "Mn" in the Unicode specification.
static final byteGeneral category "Lo" in the Unicode specification.
static final byteGeneral category "No" in the Unicode specification.
static final byteGeneral category "Po" in the Unicode specification.
static final byteGeneral category "So" in the Unicode specification.
static final byteGeneral category "Zp" in the Unicode specification.
static final byteGeneral category "Co" in the Unicode specification.
static final intThe number of bits used to represent a
charvalue in unsigned binary form, constant16.static final byteGeneral category "Zs" in the Unicode specification.
static final byteGeneral category "Ps" in the Unicode specification.
static final byteGeneral category "Cs" in the Unicode specification.
static final byteGeneral category "Lt" in the Unicode specification.
The
Classinstance representing the primitive typechar.static final byteGeneral category "Cn" in the Unicode specification.
static final byteGeneral category "Lu" in the Unicode specification.
-
Constructor Summary
Constructors
Character(char value) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
static intcharCount(int codePoint) Determines the number of
charvalues needed to represent the specified character (Unicode code point).charReturns the value of this
Characterobject.static intcodePointAt(char[] a, int index) Returns the code point at the given index of the
chararray.static intcodePointAt(char[] a, int index, int limit) Returns the code point at the given index of the
chararray, where only array elements withindexless thanlimitcan be used.static intReturns the code point at the given index of the
CharSequence.static intcodePointBefore(char[] a, int index) Returns the code point preceding the given index of the
chararray.static intcodePointBefore(char[] a, int index, int start) Returns the code point preceding the given index of the
chararray, where only array elements withindexgreater than or equal tostartcan be used.static intReturns the code point preceding the given index of the
CharSequence.static intcodePointCount(char[] a, int offset, int count) Returns the number of Unicode code points in a subarray of the
chararray argument.static intReturns the number of Unicode code points in the text range of the specified char sequence.
static intReturns the code point value of the Unicode character specified by the given character name.
static intcompare(char x, char y) Compares two
charvalues numerically.intCompares two
Characterobjects numerically.Returns an
Optionalcontaining the nominal descriptor for this instance.static intdigit(char ch, int radix) Returns the numeric value of the character
chin the specified radix.static intdigit(int codePoint, int radix) Returns the numeric value of the specified character (Unicode code point) in the specified radix.
booleanCompares this object against the specified object.
static charforDigit(int digit, int radix) Determines the character representation for a specific digit in the specified radix.
static bytegetDirectionality(char ch) Returns the Unicode directionality property for the given character.
static bytegetDirectionality(int codePoint) Returns the Unicode directionality property for the given character (Unicode code point).
getName(int codePoint) Returns the name of the specified character
codePoint, or null if the code point isunassigned.static intgetNumericValue(char ch) Returns the
intvalue that the specified Unicode character represents.static intgetNumericValue(int codePoint) Returns the
intvalue that the specified character (Unicode code point) represents.static intgetType(char ch) Returns a value indicating a character's general category.
static intgetType(int codePoint) Returns a value indicating a character's general category.
inthashCode()Returns a hash code for this
Character; equal to the result of invokingcharValue().static inthashCode(char value) Returns a hash code for a
charvalue; compatible withCharacter.hashCode().static charhighSurrogate(int codePoint) static booleanisAlphabetic(int codePoint) Determines if the specified character (Unicode code point) is alphabetic.
static booleanisBmpCodePoint(int codePoint) Determines whether the specified character (Unicode code point) is in the Basic Multilingual Plane (BMP).
static booleanisDefined(char ch) Determines if a character is defined in Unicode.
static booleanisDefined(int codePoint) Determines if a character (Unicode code point) is defined in Unicode.
static booleanisDigit(char ch) Determines if the specified character is a digit.
static booleanisDigit(int codePoint) Determines if the specified character (Unicode code point) is a digit.
static booleanisEmoji(int codePoint) Determines if the specified character (Unicode code point) is an Emoji.
static booleanisEmojiComponent(int codePoint) Determines if the specified character (Unicode code point) is an Emoji Component.
static booleanisEmojiModifier(int codePoint) Determines if the specified character (Unicode code point) is an Emoji Modifier.
static booleanisEmojiModifierBase(int codePoint) Determines if the specified character (Unicode code point) is an Emoji Modifier Base.
static booleanisEmojiPresentation(int codePoint) Determines if the specified character (Unicode code point) has the Emoji Presentation property by default.
static booleanisExtendedPictographic(int codePoint) Determines if the specified character (Unicode code point) is an Extended Pictographic.
static booleanisHighSurrogate(char ch) static booleanisIdentifierIgnorable(char ch) Determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier.
static booleanisIdentifierIgnorable(int codePoint) Determines if the specified character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.
static booleanisIdeographic(int codePoint) Determines if the specified character (Unicode code point) is a CJKV (Chinese, Japanese, Korean and Vietnamese) ideograph, as defined by the Unicode Standard.
static booleanisISOControl(char ch) Determines if the specified character is an ISO control character.
static booleanisISOControl(int codePoint) Determines if the referenced character (Unicode code point) is an ISO control character.
static booleanisJavaIdentifierPart(char ch) Determines if the specified character may be part of a Java identifier as other than the first character.
static booleanisJavaIdentifierPart(int codePoint) Determines if the character (Unicode code point) may be part of a Java identifier as other than the first character.
static booleanisJavaIdentifierStart(char ch) Determines if the specified character is permissible as the first character in a Java identifier.
static booleanisJavaIdentifierStart(int codePoint) Determines if the character (Unicode code point) is permissible as the first character in a Java identifier.
static booleanisJavaLetter(char ch) static booleanisJavaLetterOrDigit(char ch) static booleanisLetter(char ch) Determines if the specified character is a letter.
static booleanisLetter(int codePoint) Determines if the specified character (Unicode code point) is a letter.
static booleanisLetterOrDigit(char ch) Determines if the specified character is a letter or digit.
static booleanisLetterOrDigit(int codePoint) Determines if the specified character (Unicode code point) is a letter or digit.
static booleanisLowerCase(char ch) Determines if the specified character is a lowercase character.
static booleanisLowerCase(int codePoint) Determines if the specified character (Unicode code point) is a lowercase character.
static booleanisLowSurrogate(char ch) static booleanisMirrored(char ch) Determines whether the character is mirrored according to the Unicode specification.
static booleanisMirrored(int codePoint) Determines whether the specified character (Unicode code point) is mirrored according to the Unicode specification.
static booleanisSpace(char ch) static booleanisSpaceChar(char ch) Determines if the specified character is a Unicode space character.
static booleanisSpaceChar(int codePoint) Determines if the specified character (Unicode code point) is a Unicode space character.
static booleanisSupplementaryCodePoint(int codePoint) Determines whether the specified character (Unicode code point) is in the supplementary character range.
static booleanisSurrogate(char ch) Determines if the given
charvalue is a Unicode surrogate code unit.static booleanisSurrogatePair(char high, char low) static booleanisTitleCase(char ch) Determines if the specified character is a titlecase character.
static booleanisTitleCase(int codePoint) Determines if the specified character (Unicode code point) is a titlecase character.
static booleanisUnicodeIdentifierPart(char ch) Determines if the specified character may be part of a Unicode identifier as other than the first character.
static booleanisUnicodeIdentifierPart(int codePoint) Determines if the specified character (Unicode code point) may be part of a Unicode identifier as other than the first character.
static booleanisUnicodeIdentifierStart(char ch) Determines if the specified character is permissible as the first character in a Unicode identifier.
static booleanisUnicodeIdentifierStart(int codePoint) Determines if the specified character (Unicode code point) is permissible as the first character in a Unicode identifier.
static booleanisUpperCase(char ch) Determines if the specified character is an uppercase character.
static booleanisUpperCase(int codePoint) Determines if the specified character (Unicode code point) is an uppercase character.
static booleanisValidCodePoint(int codePoint) static booleanisWhitespace(char ch) Determines if the specified character is white space according to Java.
static booleanisWhitespace(int codePoint) Determines if the specified character (Unicode code point) is white space according to Java.
static charlowSurrogate(int codePoint) static intoffsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset) Returns the index within the given
charsubarray that is offset from the givenindexbycodePointOffsetcode points.static intReturns the index within the given char sequence that is offset from the given
indexbycodePointOffsetcode points.static charreverseBytes(char ch) Returns the value obtained by reversing the order of the bytes in the specified
charvalue.static char[]toChars(int codePoint) Converts the specified character (Unicode code point) to its UTF-16 representation stored in a
chararray.static inttoChars(int codePoint, char[] dst, int dstIndex) Converts the specified character (Unicode code point) to its UTF-16 representation.
static inttoCodePoint(char high, char low) Converts the specified surrogate pair to its supplementary code point value.
static chartoLowerCase(char ch) Converts the character argument to lowercase using case mapping information from the UnicodeData file.
static inttoLowerCase(int codePoint) Converts the character (Unicode code point) argument to lowercase using case mapping information from the UnicodeData file.
toString()Returns a
Stringobject representing thisCharacter's value.toString(char c) Returns a
Stringobject representing the specifiedchar.toString(int codePoint) Returns a
Stringobject representing the specified character (Unicode code point).static chartoTitleCase(char ch) Converts the character argument to titlecase using case mapping information from the UnicodeData file.
static inttoTitleCase(int codePoint) Converts the character (Unicode code point) argument to titlecase using case mapping information from the UnicodeData file.
static chartoUpperCase(char ch) Converts the character argument to uppercase using case mapping information from the UnicodeData file.
static inttoUpperCase(int codePoint) Converts the character (Unicode code point) argument to uppercase using case mapping information from the UnicodeData file.
valueOf(char c) Returns a
Characterinstance representing the specifiedcharvalue.
-
Field Details
-
MIN_RADIX
-
MAX_RADIX
-
MIN_VALUE
-
MAX_VALUE
-
TYPE
-
UNASSIGNED
-
UPPERCASE_LETTER
-
LOWERCASE_LETTER
-
TITLECASE_LETTER
-
MODIFIER_LETTER
-
OTHER_LETTER
-
NON_SPACING_MARK
-
ENCLOSING_MARK
-
COMBINING_SPACING_MARK
-
DECIMAL_DIGIT_NUMBER
-
LETTER_NUMBER
-
OTHER_NUMBER
-
SPACE_SEPARATOR
-
LINE_SEPARATOR
-
PARAGRAPH_SEPARATOR
-
CONTROL
-
FORMAT
-
PRIVATE_USE
-
SURROGATE
-
DASH_PUNCTUATION
-
START_PUNCTUATION
-
END_PUNCTUATION
-
CONNECTOR_PUNCTUATION
-
OTHER_PUNCTUATION
-
MATH_SYMBOL
-
CURRENCY_SYMBOL
-
MODIFIER_SYMBOL
-
OTHER_SYMBOL
-
INITIAL_QUOTE_PUNCTUATION
-
FINAL_QUOTE_PUNCTUATION
-
DIRECTIONALITY_UNDEFINED
-
DIRECTIONALITY_LEFT_TO_RIGHT
-
DIRECTIONALITY_RIGHT_TO_LEFT
-
DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC
-
DIRECTIONALITY_EUROPEAN_NUMBER
-
DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR
-
DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR
-
DIRECTIONALITY_ARABIC_NUMBER
-
DIRECTIONALITY_COMMON_NUMBER_SEPARATOR
-
DIRECTIONALITY_NONSPACING_MARK
-
DIRECTIONALITY_BOUNDARY_NEUTRAL
-
DIRECTIONALITY_PARAGRAPH_SEPARATOR
-
DIRECTIONALITY_SEGMENT_SEPARATOR
-
DIRECTIONALITY_WHITESPACE
-
DIRECTIONALITY_OTHER_NEUTRALS
-
DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING
-
DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE
-
DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING
-
DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE
-
DIRECTIONALITY_POP_DIRECTIONAL_FORMAT
-
DIRECTIONALITY_LEFT_TO_RIGHT_ISOLATE
-
DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE
-
DIRECTIONALITY_FIRST_STRONG_ISOLATE
-
DIRECTIONALITY_POP_DIRECTIONAL_ISOLATE
-
MIN_HIGH_SURROGATE
-
MAX_HIGH_SURROGATE
-
MIN_LOW_SURROGATE
-
MAX_LOW_SURROGATE
-
MIN_SURROGATE
-
MAX_SURROGATE
-
MIN_SUPPLEMENTARY_CODE_POINT
-
MIN_CODE_POINT
-
MAX_CODE_POINT
-
SIZE
-
BYTES
-
-
Constructor Details
-
Character
-
-
Method Details
-
describeConstable
-
valueOf
-
charValue
-
hashCode
-
hashCode
-
equals
-
toString
-
toString
-
toString
-
isValidCodePoint
-
isBmpCodePoint
-
isSupplementaryCodePoint
-
isHighSurrogate
-
isLowSurrogate
-
isSurrogate
-
isSurrogatePair
-
charCount
-
toCodePoint
-
codePointAt
-
codePointAt
-
codePointAt
-
codePointBefore
-
codePointBefore
-
codePointBefore
-
highSurrogate
-
lowSurrogate
-
toChars
-
toChars
-
codePointCount
-
codePointCount
-
offsetByCodePoints
-
offsetByCodePoints
-
isLowerCase
-
isLowerCase
-
isUpperCase
-
isUpperCase
-
isTitleCase
-
isTitleCase
-
isDigit
-
isDigit
-
isDefined
-
isDefined
-
isLetter
-
isLetter
-
isLetterOrDigit
-
isLetterOrDigit
-
isJavaLetter
-
isJavaLetterOrDigit
-
isAlphabetic
-
isIdeographic
-
isJavaIdentifierStart
-
isJavaIdentifierStart
-
isJavaIdentifierPart
-
isJavaIdentifierPart
-
isUnicodeIdentifierStart
-
isUnicodeIdentifierStart
-
isUnicodeIdentifierPart
-
isUnicodeIdentifierPart
-
isIdentifierIgnorable
-
isIdentifierIgnorable
-
isEmoji
-
isEmojiPresentation
-
isEmojiModifier
-
isEmojiModifierBase
-
isEmojiComponent
-
isExtendedPictographic
-
toLowerCase
-
toLowerCase
-
toUpperCase
-
toUpperCase
-
toTitleCase
-
toTitleCase
-
digit
-
digit
-
getNumericValue
-
getNumericValue
-
isSpace
-
isSpaceChar
-
isSpaceChar
-
isWhitespace
-
isWhitespace
-
isISOControl
-
isISOControl
-
getType
-
getType
-
forDigit
-
getDirectionality
-
getDirectionality
-
isMirrored
-
isMirrored
-
compareTo
-
compare
-
reverseBytes
-
getName
-
codePointOf
-