Gitchat连接
https://gitbook.cn/gitchat/activity/5f50804bbe67a5348a9b2c91
简介
从底层,从原理,我们来重学一次 Java。Character 是char(字符)的封装类,是String用于字符存储的类型,他的源码及实现是怎样的呢?
本系列秉承所有结论尽量从源码中来,没有源码的尽量标明出处。相关源码会附着在文章中,读本文即可,不用再自行查找源码及资料学习,方便大家充分利用路上的碎片时间。
本篇 Chat 对Character的属性、构造函数、字符数据等进行逐一源码分析,帮助大家深入理解和学习 JDK 源码。
本文包含以下内容:
- 类信息
- 类的定义
- 类的继承结构
- 常量
- 进制数范围
- char类型值域
- UTF-16编码范围
- Unicode码位范围
- 基本类型
- 一般类别
- 位数、字节数
- Subset
- UnicodeBlock
- 类定义
- map
- 构造函数
- 各块静态常量
- blockStarts
- blocks
- of(char c)
- of(int codePoint)
- forName(String blockName)
- UnicodeScript
- scriptStarts
- scripts
- aliases(别名)
- of(int codePoint)
- Character.isValidCodePoint(int codePoint)
- Character.getType(int codePoint)
- CharacterData.of(int ch)
- CharacterDataLatin1
- Arrays.binarySearch(int[] a, int key)
- forName(String scriptName)
- value属性
- 构造函数
- CharacterCache
- valueOf
- charValue
- hashCode
- equals
- toString
- toString()
- String.valueOf(char data[])
- String的String(char value[])构造函数
- Arrays.copyOf(char[] original, int newLength)
- toString(char c)
- String.valueOf(char c)
- String(char[] value, boolean share)
- 比较两者
- toString()
- 几个判断函数
- isValidCodePoint(int codePoint)
- isBmpCodePoint(int codePoint)
- isSupplementaryCodePoint(int codePoint)
- isHighSurrogate(char ch)
- isLowSurrogate(char ch)
- isSurrogate(char ch)
- isSurrogatePair(char high, char low)
- charCount(int codePoint)
- 大小写判断
- 小写判断
- 大写判断
- 大小写转换
- 转小写
- toLowerCase(char ch)
- toLowerCase(int codePoint)
- 转大写
- toUpperCase(char ch)
- toUpperCase(int codePoint)
- CharacterDataLatin1.toUpperCase(int ch)
- 转小写
- UTF-16处理
- toSurrogates(int codePoint, char[] dst, int index)
- highSurrogate(int codePoint)
- lowSurrogate(int codePoint)
- forDigit(int digit, int radix)
适用人群:有一些 Java 基础的人群。