public class Segment extends Object implements Cloneable, CharacterIterator, CharSequence
该段实行java.text.characteriterator接口与i18n支持不支持使用复制的文本转换成一个字符串。
Modifier and Type | Field and Description |
---|---|
char[] |
array
这是包含感兴趣的文本的数组。
|
int |
count
这是构成感兴趣的文本的数组元素的数量。
|
int |
offset
这是偏移到所需的文本开始的数组中。
|
DONE
Constructor and Description |
---|
Segment()
创建一个新的段。
|
Segment(char[] array, int offset, int count)
创建一个引用现有数组的新段。
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index)
返回指定索引的
char 价值。
|
Object |
clone()
创建一个浅副本。
|
char |
current()
获取当前位置的字符(如返回getindex())。
|
char |
first()
设置位置getbeginindex()返回那个位置的字符。
|
int |
getBeginIndex()
返回文本的开始索引。
|
int |
getEndIndex()
返回文本的结束索引。
|
int |
getIndex()
返回当前索引。
|
boolean |
isPartialReturn()
标记表示部分返回是有效的。
|
char |
last()
集getendindex() - 1的位置(getendindex()如果文本是空的)并返回在那个位置的字符。
|
int |
length()
返回此字符序列的长度。
|
char |
next()
通过一个增量迭代迭代器的索引,并返回新索引中的字符。
|
char |
previous()
使迭代器的指数和返回新指标的特点。
|
char |
setIndex(int position)
将位置设置为文本中指定的位置,并返回该字符。
|
void |
setPartialReturn(boolean p)
标记表示部分返回是有效的。
|
CharSequence |
subSequence(int start, int end)
返回一个
CharSequence 是子序列。
|
String |
toString()
将段转换为字符串。
|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chars, codePoints
public char[] array
public int offset
public int count
public Segment()
public Segment(char[] array, int offset, int count)
array
-数组引用
offset
-偏移到数组
count
-字符数
public void setPartialReturn(boolean p)
p
是否有效部分的回报。
public boolean isPartialReturn()
public String toString()
toString
接口
CharSequence
toString
方法重写,继承类
Object
public char first()
first
接口
CharacterIterator
getBeginIndex()
public char last()
last
接口
CharacterIterator
getEndIndex()
public char current()
current
接口
CharacterIterator
getIndex()
public char next()
next
接口
CharacterIterator
public char previous()
previous
接口
CharacterIterator
public char setIndex(int position)
setIndex
接口
CharacterIterator
position
-在文本中的位置。有效值的范围从getbeginindex()到getendindex()。IllegalArgumentException是如果提供了一个无效的值被。
public int getBeginIndex()
getBeginIndex
接口
CharacterIterator
public int getEndIndex()
getEndIndex
接口
CharacterIterator
public int getIndex()
getIndex
接口
CharacterIterator
public char charAt(int index)
char
价值。一个指数的范围从零到
length() - 1。第一序列的
char
值在指数为零,在指标下,等等,作为数组索引。
如果由索引指定的char
值是一个surrogate,代孕的返回值。
charAt
接口
CharSequence
index
的
char
返回值指数
char
价值
public int length()
char
s数。
length
接口
CharSequence
char
s数
public CharSequence subSequence(int start, int end)
CharSequence
是子序列。随后开始在指定的索引和结束索引
end - 1的
char
价值
char
价值。的长度(在
char
s)的返回顺序
end - start,所以如果
start == end然后返回空序列。
subSequence
接口
CharSequence
start
的起始索引,包括
end
结束的指标,独家
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.