public interface CharSequence
char值序列。这个接口提供了统一的,许多不同种类的
char序列的只读访问。一个
char值代表在基本多文种平面字符(BMP)或替代。参考
Unicode Character Representation详情。
此接口不完善的equals和hashCode方法一般合同。在一般的比较,因此,实施CharSequence两物体的结果,定义。每个对象可能由一个不同的类来实现,并没有保证每个类都将能够测试它的实例与其他的平等。因此,恰当的使用任意CharSequence实例作为一套或在Map的关键因素是。
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index)
返回指定索引的
char价值。
|
default IntStream |
chars()
返回一个流
int零扩展
char值从这个序列。
|
default IntStream |
codePoints()
从这个序列返回一个代码点的流。
|
int |
length()
返回此字符序列的长度。
|
CharSequence |
subSequence(int start, int end)
返回一个
CharSequence是子序列。
|
String |
toString()
返回一个字符串,该字符串包含在该序列中的同一顺序的这个序列中的字符。
|
int length()
chars数。
chars数
char charAt(int index)
char价值。一个指数的范围从零到
length() - 1。第一序列的
char值在指数为零,在指标下,等等,作为数组索引。
如果由索引指定的char值是一个surrogate,代孕的返回值。
index的
char返回值指数
char价值
IndexOutOfBoundsException -如果
index参数为负或不少于
length()
CharSequence subSequence(int start, int end)
CharSequence是子序列。随后开始在指定的索引和结束索引
end - 1的
char价值
char价值。的长度(在
chars)的返回顺序
end - start,所以如果
start == end然后返回空序列。
start的起始索引,包括
end结束的指标,独家
IndexOutOfBoundsException -如果
start或
end是负面的,如果
end大于
length(),或者如果
start大于
end
String toString()
default IntStream chars()
default IntStream codePoints()
int然后传递给流值。
如果在读取流时序列发生突变,则结果是未定义的。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.