📜  Java.lang。字符类

📅  最后修改于: 2020-11-15 02:56:44             🧑  作者: Mango


介绍

java.lang。字符类将原始类型char的值包装在对象中。类型为字符的对象包含一个类型为char的字段。

类声明

以下是java.lang的声明。字符类-

public final class Character
   extends Object
      implements Serializable, Comparable

领域

以下是java.lang的字段。字符类-

  • 静态字节COMBINING_SPACING_MARK-这是Unicode规范中的常规类别“ Mc”。

  • 静态字节CONNECTOR_PUNCTUATION-这是Unicode规范中的常规类别“ Pc”。

  • 静态字节控制-这是Unicode规范中的常规类别“ Cc”。

  • 静态字节CURRENCY_SYMBOL-这是Unicode规范中的常规类别“ Sc”。

  • 静态字节DASH_PUNCTUATION-这是Unicode规范中的常规类别“ Pd”。

  • 静态字节DECIMAL_DIGIT_NUMBER-这是Unicode规范中的常规类别“ Nd”。

  • 静态字节DIRECTIONALITY_ARABIC_NUMBER-这是Unicode规范中的弱双向字符类型“ AN”。

  • 静态字节DIRECTIONALITY_BOUNDARY_NEUTRAL-这是Unicode规范中的弱双向字符类型“ BN”。

  • 静态字节DIRECTIONALITY_COMMON_NUMBER_SEPARATOR-这是Unicode规范中的弱双向字符类型“ CS”。

  • 静态字节DIRECTIONALITY_EUROPEAN_NUMBER-这是Unicode规范中的弱双向字符类型“ EN”。

  • 静态字节DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR-这是Unicode规范中的弱双向字符类型“ ES”。

  • 静态字节DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR-这是Unicode规范中的弱双向字符类型“ ET”。

  • 静态字节DIRECTIONALITY_LEFT_TO_RIGHT-这是Unicode规范中的强双向字符类型“ L”。

  • 静态字节DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING-这是Unicode规范中的强双向字符类型“ LRE”。

  • 静态字节DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE-这是Unicode规范中的强双向字符类型“ LRO”。

  • 静态字节DIRECTIONALITY_NONSPACING_MARK-这是Unicode规范中的弱双向字符类型“ NSM”。

  • 静态字节DIRECTIONALITY_OTHER_NEUTRALS-这是Unicode规范中的中性双向字符类型“ ON”。

  • 静态字节DIRECTIONALITY_PARAGRAPH_SEPARATOR-这是Unicode规范中的中性双向字符类型“ B”。

  • 静态字节DIRECTIONALITY_POP_DIRECTIONAL_FORMAT-这是Unicode规范中的弱双向字符类型“ PDF”。

  • 静态字节DIRECTIONALITY_RIGHT_TO_LEFT-这是Unicode规范中的强双向字符类型“ R”。

  • 静态字节DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC-这是Unicode规范中的强双向字符类型“ AL”。

  • 静态字节DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING-这是Unicode规范中的强双向字符类型“ RLE”。

  • 静态字节DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE-这是Unicode规范中的强双向字符类型“ RLO”。

  • 静态字节DIRECTIONALITY_SEGMENT_SEPARATOR-这是Unicode规范中的中性双向字符类型“ S”。

  • 静态字节DIRECTIONALITY_UNDEFINED-这是未定义的双向字符类型。

  • 静态字节DIRECTIONALITY_WHITESPACE-这是Unicode规范中的中性双向字符类型“ WS”。

  • 静态字节ENCLOSING_MARK-这是Unicode规范中的常规类别“ Me”。

  • 静态字节END_PUNCTUATION-这是Unicode规范中的常规类别“ Pe”。

  • 静态字节FINAL_QUOTE_PUNCTUATION-这是Unicode规范中的常规类别“ Pf”。

  • 静态字节格式-这是Unicode规范中的常规类别“ Cf”。

  • 静态字节INITIAL_QUOTE_PUNCTUATION-这是Unicode规范中的常规类别“ Pi”。

  • 静态字节LETTER_NUMBER-这是Unicode规范中的常规类别“ Nl”。

  • 静态字节LINE_SEPARATOR-这是Unicode规范中的常规类别“ Zl”。

  • 静态字节LOWERCASE_LETTER-这是Unicode规范中的常规类别“ Ll”。

  • 静态字节MATH_SYMBOL-这是Unicode规范中的常规类别“ Sm”。

  • static int MAX_CODE_POINT-这是Unicode代码点的最大值。

  • 静态字符MAX_HIGH_SURROGATE-这是UTF-16编码中Unicode高代理代码单元的最大值。

  • 静态字符MAX_LOW_SURROGATE-这是UTF-16编码中Unicode低代理代码单元的最大值。

  • static int MAX_RADIX-这是可用于在字符串转换的最大基数。

  • 静态字符MAX_SURROGATE-这是UTF-16编码中的Unicode替代代码单元的最大值。

  • static char MAX_VALUE-这是该字段的常数,是char类型’\ uFFFF’的最大值。

  • 静态整数MIN_CODE_POINT-这是Unicode代码点的最小值

  • 静态字符MIN_HIGH_SURROGATE-这是UTF-16编码中的Unicode高替代代码单元的最小值。

  • 静态字符MIN_LOW_SURROGATE-这是UTF-16编码中的Unicode低代理代码单元的最小值。

  • static int MIN_RADIX-这是可用于在字符串转换的最小基数。

  • static int MIN_SUPPLEMENTARY_CODE_POINT-这是补充代码点的最小值。

  • 静态字符MIN_SURROGATE-这是UTF-16编码中的Unicode替代代码单元的最小值。

  • 静态字符MIN_VALUE-这是此字段的常数,是字符类型’\ u0000’的最小值。

  • 静态字节MODIFIER_LETTER-这是Unicode规范中的常规类别“ Lm”。

  • 静态字节MODIFIER_SYMBOL-这是Unicode规范中的常规类别“ Sk”。

  • 静态字节NON_SPACING_MARK-这是Unicode规范中的常规类别“ Mn”。

  • 静态字节OTHER_LETTER-这是Unicode规范中的常规类别“ Lo”。

  • 静态字节OTHER_NUMBER-这是Unicode规范中的常规类别“否”。

  • 静态字节OTHER_PUNCTUATION-这是Unicode规范中的常规类别“ Po”。

  • 静态字节OTHER_SYMBOL-这是Unicode规范中的常规类别“ So”。

  • 静态字节PARAGRAPH_SEPARATOR-这是Unicode规范中的常规类别“ Zp”。

  • 静态字节PRIVATE_USE-这是Unicode规范中的常规类别“ Co”。

  • static int SIZE-这是用来表示无符号二进制形式的char值的位数。

  • 静态字节SPACE_SEPARATOR-这是Unicode规范中的常规类别“ Zs”。

  • 静态字节START_PUNCTUATION-这是Unicode规范中的常规类别“ Ps”。

  • 静态字节SURROGATE-这是Unicode规范中的常规类别“ Cs”。

  • 静态字节TITLECASE_LETTER-这是Unicode规范中的常规类别“ Lt”。

  • 静态Class < 字符> TYPE-这是表示原始类型char的Class实例。

  • 静态字节UNASSIGNED-这是Unicode规范中的常规类别“ Cn”。

  • 静态字节UPPERCASE_LETTER-这是Unicode规范中的常规类别“ Lu”。

类的构造函数

Sr.No. Constructor & Description
1

Character(char value)

This constructs a newly allocated Character object that represents the specified char value.

类方法

Sr.No. Method & Description
1 static int charCount(int codePoint)

This method determines the number of char values needed to represent the specified character (Unicode code point).

2 char charValue()

This method returns the value of this Character object.

3 static int codePointAt(char[] a, int index)

This method returns the code point at the given index of the char array.

4 static int codePointAt(char[] a, int index, int limit)

This method returns the code point at the given index of the char array, where only array elements with index less than limit can be used.

5 static int codePointAt(CharSequence seq, int index)

This method returns the code point at the given index of the CharSequence.

6 static int codePointBefore(char[] a, int index)

This method returns the code point preceding the given index of the char array.

7 static int codePointBefore(char[] a, int index, int start)

This method returns the code point preceding the given index of the char array, where only array elements with index greater than or equal to start can be used.

8 static int codePointBefore(CharSequence seq, int index)

This method returns the code point preceding the given index of the CharSequence.

9 static int codePointCount(char[] a, int offset, int count)

This method returns the number of Unicode code points in a subarray of the char array argument

10 static int codePointCount(CharSequence seq, int beginIndex, int endIndex)

This method returns the number of Unicode code points in the text range of the specified char sequence.

11 int compareTo(Character anotherCharacter)

This method compares two Character objects numerically.

12 static int digit(char ch, int radix)

This method returns the numeric value of the character ch in the specified radix.

13 static int digit(int codePoint, int radix)

This method returns the numeric value of the specified character (Unicode code point) in the specified radix.

14 boolean equals(Object obj)

This method compares this object against the specified object

15 static char forDigit(int digit, int radix)

This method determines the character representation for a specific digit in the specified radix.

16 static byte getDirectionality(char ch)

This method returns the Unicode directionality property for the given character.

17 static byte getDirectionality(int codePoint)

This method returns the Unicode directionality property for the given character (Unicode code point).

18 static int getNumericValue(char ch)

This method returns the int value that the specified Unicode character represents.

19 static int getNumericValue(int codePoint)

This method returns the int value that the specified character (Unicode code point) represents.

20 static int getType(char ch)

This method returns a value indicating a character’s general category.

21 static int getType(int codePoint)

This method returns a value indicating a character’s general category.

22 int hashCode()

This method returns a hash code for this Character.

23 static boolean isDefined(char ch)

This method determines if a character is defined in Unicode.

24 static boolean isDefined(int codePoint)

This method determines if a character (Unicode code point) is defined in Unicode.

25 static boolean isDigit(char ch)

This method determines if the specified character is a digit.

26 static boolean isDigit(int codePoint)

This method determines if the specified character (Unicode code point) is a digit.

27 static boolean isHighSurrogate(char ch)

This method determines if the given char value is a high-surrogate code unit (also known as leading-surrogate code unit).

28 static boolean isIdentifierIgnorable(char ch)

This method determines if the specified character should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

29 static boolean isIdentifierIgnorable(int codePoint)

This method determines if the specified character (Unicode code point) should be regarded as an ignorable character in a Java identifier or a Unicode identifier.

30 static boolean isISOControl(char ch)

This method determines if the specified character is an ISO control character.

31 static boolean isISOControl(int codePoint)

This method determines if the referenced character (Unicode code point) is an ISO control character.

32 static boolean isJavaIdentifierPart(char ch)

This method determines if the specified character may be part of a Java identifier as other than the first character.

33 static boolean isJavaIdentifierPart(int codePoint)

This method determines if the character (Unicode code point) may be part of a Java identifier as other than the first character.

34 static boolean isJavaIdentifierStart(char ch)

This method determines if the specified character is permissible as the first character in a Java identifier.

35 static boolean isJavaIdentifierStart(int codePoint)

This method determines if the character (Unicode code point) is permissible as the first character in a Java identifier.

36 static boolean isLetter(char ch)

This method determines if the specified character is a letter.

37 static boolean isLetter(int codePoint)

This method determines if the specified character (Unicode code point) is a letter.

38 static boolean isLetterOrDigit(char ch)

This method determines if the specified character is a letter or digit.

39 static boolean isLetterOrDigit(int codePoint)

This method determines if the specified character (Unicode code point) is a letter or digit.

40 static boolean isLowerCase(char ch)

This method determines if the specified character is a lowercase character.

41 static boolean isLowerCase(int codePoint)

This method determines if the specified character (Unicode code point) is a lowercase character.

42 static boolean isLowSurrogate(char ch)

This method determines if the given char value is a low-surrogate code unit (also known as trailing-surrogate code unit).

43 static boolean isMirrored(char ch)

This method determines whether the character is mirrored according to the Unicode specification.

44 static boolean isMirrored(int codePoint)

This method determines whether the specified character (Unicode code point) is mirrored according to the Unicode specification.

45 static boolean isSpaceChar(char ch)

This method determines if the specified character is a Unicode space character.

46 static boolean isSpaceChar(int codePoint)

This method determines if the specified character (Unicode code point) is a Unicode space character.

47 static boolean isSupplementaryCodePoint(int codePoint)

This method determines whether the specified character (Unicode code point) is in the supplementary character range.

48 static boolean isSurrogatePair(char high, char low)

This method determines whether the specified pair of char values is a valid surrogate pair.

49 static boolean isTitleCase(char ch)

This method determines if the specified character is a titlecase character.

50 static boolean isTitleCase(int codePoint)

This method determines if the specified character (Unicode code point) is a titlecase character.

51 static boolean isUnicodeIdentifierPart(char ch)

This method determines if the specified character may be part of a Unicode identifier as other than the first character.

52 static boolean isUnicodeIdentifierPart(int codePoint)

This method determines if the specified character (Unicode code point) may be part of a Unicode identifier as other than the first character.

53 static boolean isUnicodeIdentifierStart(char ch)

This method determines if the specified character is permissible as the first character in a Unicode identifier.

54 static boolean isUnicodeIdentifierStart(int codePoint)

This method determines if the specified character (Unicode code point) is permissible as the first character in a Unicode identifier.

55 static boolean isUpperCase(char ch

This method determines if the specified character is an uppercase character.

56 static boolean isUpperCase(int codePoint)

This method determines if the specified character (Unicode code point) is an uppercase character.

57 static boolean isValidCodePoint(int codePoint)

This method determines whether the specified code point is a valid Unicode code point value in the range of 0x0000 to 0x10FFFF inclusive.

58 static boolean isWhitespace(char ch)

This method determines if the specified character is white space according to Java.

59 static boolean isWhitespace(int codePoint)

This method determines if the specified character (Unicode code point) is white space according to Java.

60 static int offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset)

This method returns the index within the given char subarray that is offset from the given index by codePointOffset code points

61 static int offsetByCodePoints(CharSequence seq, int index, int codePointOffset)

This method returns the index within the given char sequence that is offset from the given index by codePointOffset code points.

62 static char reverseBytes(char ch)

This method returns the value obtained by reversing the order of the bytes in the specified char value.

63 static char[] toChars(int codePoint)

This method converts the specified character (Unicode code point) to its UTF-16 representation stored in a char array.

64 static int toChars(int codePoint, char[] dst, int dstIndex)

This method converts the specified character (Unicode code point) to its UTF-16 representation.

65 static int toCodePoint(char high, char low)

This method converts the specified surrogate pair to its supplementary code point value.

66 static char toLowerCase(char ch)

This method converts the character argument to lowercase using case mapping information from the UnicodeData file.

67 static int toLowerCase(int codePoint)

This method converts the character (Unicode code point) argument to lowercase using case mapping information from the UnicodeData file.

68 String toString()

This method returns a String object representing this Character’s value.

69 static String toString(char c)

This method returns a String object representing the specified char.

70 static char toTitleCase(char ch)

This method converts the character argument to titlecase using case mapping information from the UnicodeData file.

71 static int toTitleCase(int codePoint)

This method converts the character (Unicode code point) argument to titlecase using case mapping information from the UnicodeData file.

72 static char toUpperCase(char ch)

This method converts the character argument to uppercase using case mapping information from the UnicodeData file.

73 static int toUpperCase(int codePoint)

This method converts the character (Unicode code point) argument to uppercase using case mapping information from the UnicodeData file.

74 static Character valueOf(char c)

This method returns a Character instance representing the specified char value.

方法继承

此类从以下类继承方法-

  • java.lang.Object