Java.lang.Character类的功能简介说明
下文笔者将讲述Java.lang.Character类的功能简介说明,如下所示:
是一个将基础类型char值包装为一个对象,
每一个Character类都只包含一个char字段
Java.lang Character类介绍
Java.lang.Character类是一个将基础类型char值包装为一个对象,
每一个Character类都只包含一个char字段
Character类中的所有字段,方法,构造函数都由Unicode数据文件指定
Java.lang Character类的声明方法
public final class Character extends Object implements Serializable, Comparable<Character>
Java.lang Character方法包含的方法如下表所示
方法 | 描述 |
---|---|
static int charCount(int codePoint) | 此方法确定表示指定字符所需的字符的值的数目(Unicode代码点)。 |
char charValue() | 此方法返回字符对象的值。 |
static int codePointAt(char[] a, int index) | 此方法返回char数组的给定索引上的代码点。 |
static int codePointAt(char[] a, int index, int limit) | 此方法返回的字符数组,只能用于数组元素与指数低于上限的定索引上的代码点。 |
static int codePointAt(CharSequence seq, int index) | 此方法返回CharSequence给定索引上的代码点。 |
static int codePointBefore(char[] a, int index) | 此方法返回char数组的给定索引前面的代码点。 |
static int codePointBefore(char[] a, int index, int start) | 此方法返回字符数组,其中仅可用于数组元素与指数大于或等于开始的给定索引前面的代码点。 |
static int codePointBefore(CharSequence seq, int index) | 此方法返回CharSequence给定索引前面的代码点。 |
static int codePointCount(char[] a, int offset, int count) | 该方法在char数组参数的一个子返回的Unicode代码点的数量 |
static int codePointCount(CharSequence seq, int beginIndex, int endIndex) | 该方法在指定的字符序列的文本范围返回的Unicode代码点的数量。 |
int compareTo(Character anotherCharacter) | 该方法在数字上比较两个字符的对象。 |
static int digit(char ch, int radix) | 此方法返回指定基数字符ch的数值。 |
static int digit(int codePoint, int radix) | 此方法返回指定基数指定字符(Unicode代码点)的数值。 |
boolean equals(Object obj) | 该方法此对象与指定对象比较 |
static char forDigit(int digit, int radix) | 此方法确定的指定基数的特定数字的字符表示。 |
static byte getDirectionality(char ch) | 此方法返回给定字符的Unicode的方向属性。 |
static byte getDirectionality(int codePoint) | 该方法返回给定字符(Unicode代码点)的Unicode方向属性。 |
static int getNumericValue(char ch) | 此方法返回指定的Unicode字符表示的int值。 |
static int getNumericValue(int codePoint) | 此方法返回int值指定的字符(Unicode代码点)表示。 |
static int getType(char ch) | 此方法返回一个值,表明一个字符的普通类。 |
static int getType(int codePoint) | 此方法返回一个值,表明一个字符的普通类。 |
int hashCode() | 此方法返回这个字符的哈希码。 |
static boolean isDefined(char ch) | 此方法确定字符是否为Unicode定义。 |
static boolean isDefined(int codePoint) | 该方法确定的字符(Unicode代码点)在Unicode中定义。 |
static boolean isDigit(char ch) | 此方法确定指定字符是否一个数字。 |
static boolean isDigit(int codePoint) | 此方法确定指定字符(Unicode代码点)是其中一位。 |
static boolean isHighSurrogate(char ch) | 该方法判断给定char值是高代理项代码单元(也称为主导代理项代码单元)。 |
static boolean isIdentifierIgnorable(char ch) | 此方法确定指定字符是否应该被视为一个可忽略的字符在Java标识符或Unicode标识符。 |
static boolean isIdentifierIgnorable(int codePoint) | 此方法确定指定字符(Unicode代码点)应被视为一个可忽略的字符在Java标识符或Unicode标识符。 |
static boolean isISOControl(char ch) | 此方法确定指定字符是否ISO控制字符。 |
static boolean isISOControl(int codePoint) | 此方法确定引用的字符(Unicode代码点)是一家通过ISO控制字符。 |
static boolean isJavaIdentifierPart(char ch) | 该方法确定指定的字符可能是Java标识符中除首字符以外的部分。 |
static boolean isJavaIdentifierPart(int codePoint) | 该方法确定的字符(Unicode代码点)可能是Java标识符中除首字符以外的部分。 |
static boolean isJavaIdentifierStart(char ch) | 此方法确定指定字符是否允许在Java标识符的第一个字符。 |
static boolean isJavaIdentifierStart(int codePoint) | 该方法确定的字符(Unicode代码点)是否允许在Java标识符的第一个字符。 |
static boolean isLetter(char ch) | 此方法确定指定字符是否一个字母。 |
static boolean isLetter(int codePoint) | 此方法确定指定字符(Unicode代码点)是一个字母。 |
static boolean isLetterOrDigit(char ch) | 此方法确定指定字符是字母或数字。 |
static boolean isLetterOrDigit(int codePoint) | 此方法确定指定字符(Unicode代码点)是一个字母或数字。 |
static boolean isLowerCase(char ch) | 此方法确定指定字符是否为小写字母。 |
static boolean isLowerCase(int codePoint) | 此方法确定指定字符(Unicode代码点)是否为小写字母。 |
static boolean isLowSurrogate(char ch) | 该方法判断给定char值是低代理项代码单元(也称为尾部代理项代码单元)。 |
static boolean isMirrored(char ch) | 此方法确定按照Unicode规范的字符是否为镜像。 |
static boolean isMirrored(int codePoint) | 此方法确定指定字符(Unicode代码点)是否按照Unicode规范镜像。 |
static boolean isSpaceChar(char ch) | 此方法确定指定字符是否为Unicode空白字符。 |
static boolean isSpaceChar(int codePoint) | 此方法确定指定字符(Unicode代码点)是一个Unicode空格字符。 |
static boolean isSupplementaryCodePoint(int codePoint) | 此方法确定指定字符(Unicode代码点)是否在补充字符范围。 |
static boolean isSurrogatePair(char high, char low) | 此方法确定指定对char值是否一个有效的代理对。 |
static boolean isTitleCase(char ch) | 此方法确定指定字符是否是首字母大写字符。 |
static boolean isTitleCase(int codePoint) | 此方法确定指定字符(Unicode代码点)是一个首字母大写字符。 |
static boolean isUnicodeIdentifierPart(char ch) | 此方法确定指定字符可以是Unicode标识符中除首字符以外的部分。 |
static boolean isUnicodeIdentifierPart(int codePoint) | 此方法确定指定字符(Unicode代码点)可能是Unicode标识符中除首字符以外的部分。 |
static boolean isUnicodeIdentifierStart(char ch) | 此方法确定指定字符是否是允许作为Unicode标识符的第一个字符。 |
static boolean isUnicodeIdentifierStart(int codePoint) | 此方法确定指定字符(Unicode代码点)是允许作为Unicode标识符的第一个字符。 |
static boolean isUpperCase(char ch) | 此方法确定指定字符是否是大写字符。 |
static boolean isUpperCase(int codePoint) | 此方法确定指定字符(Unicode代码点)是一个大写字母。 |
static boolean isValidCodePoint(int codePoint) | 此方法确定指定的代码点是否为0x0000〜0x10FFFF之间包容的范围内有效的Unicode代码点值。 |
static boolean isWhitespace(char ch) | 此方法确定指定字符是否是根据Java的空白符。 |
static boolean isWhitespace(int codePoint) | 此方法确定指定字符(Unicode代码点)是根据Java的空白符。 |
static int offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset) | 此方法返回从给定指数codePointOffset码点的偏移给定的字符子数组中的索引 |
static int offsetByCodePoints(CharSequence seq, int index, int codePointOffset) | 此方法返回给定字符序列从给定的指数codePointOffset码点偏移中的索引。 |
static char reverseBytes(char ch) | 此方法返回通过反转指定char值的字节的顺序而获得的值。 |
static char[] toChars(int codePoint) | 该方法将指定字符(Unicode代码点)到其存储在一个字符数组的UTF-16表示形式。 |
static int toChars(int codePoint, char[] dst, int dstIndex) | 该方法将指定字符(Unicode代码点)其UTF-16表示形式。 |
static int toCodePoint(char high, char low) | 该方法指定的代理对到其增补代码点值转换。 |
static char toLowerCase(char ch) | 该方法的参数字符使用来自UnicodeData文件的大小写映射信息转换成小写。 |
static int toLowerCase(int codePoint) | 此方法转换的字符(Unicode代码点)参数使用来自UnicodeData文件的大小写映射信息为小写。 |
String toString() | 该方法返回一个代表该字符的值的String对象。 |
static String toString(char c) | 此方法返回一个表示指定字符的String对象。 |
static char toTitleCase(char ch) | 该方法的参数字符使用来自UnicodeData文件的大小写映射信息标题字符转换。 |
static int toTitleCase(int codePoint) | 此方法转换的字符(Unicode代码点)参数使用来自UnicodeData文件的大小写映射信息标题字符。 |
static char toUpperCase(char ch) | 该方法的参数字符使用来自UnicodeData文件的大小写映射信息转换为大写。 |
static int toUpperCase(int codePoint) | 此方法转换的字符(Unicode代码点)参数使用来自UnicodeData文件的大小写映射信息为大写。 |
static Character valueOf(char c) | 此方法返回一个表示指定字符值的字符实例。 |
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。