public interface AttributedCharacterIterator
implements CharacterIterator
| java.text.AttributedCharacterIterator |
AttributedCharacterIterator允许迭代文本和相关的属性信息。
属性是由键标识的键/值对。 给定角色的两个属性不能具有相同的密钥。
属性的值是不可改变的,或者不能被客户端或存储器突变。 它们总是通过引用传递,而不是克隆。
针对属性的运行是以下最大文本范围:
null for the entire range, or null value for the entire range. 针对一组属性的运行是针对每个成员属性满足该条件的最大文本范围。
当没有指定明确属性的运行(即调用 getRunStart()和 getRunLimit() )时,如果属性已被赋予这些文本,那么具有相同属性(相同的一组属性/值对)的任何连续文本段将被视为单独运行分开分段。
返回的索引被限制在迭代器的范围内。
返回的属性信息仅限于包含当前字符的运行。
属性键是 AttributedCharacterIterator.Attribute及其子类的实例,如 TextAttribute 。
Nested classes |
|
|---|---|
class |
AttributedCharacterIterator.Attribute 定义用于标识文本属性的属性键。 |
Inherited constants |
|---|
java.text.CharacterIterator
|
公共方法(Public methods) |
|
|---|---|
abstract Set<AttributedCharacterIterator.Attribute> |
getAllAttributeKeys() 返回迭代器文本范围中定义的所有属性的键。 |
abstract Object |
getAttribute(AttributedCharacterIterator.Attribute attribute) 返回当前字符的名称 |
abstract Map<AttributedCharacterIterator.Attribute, Object> |
getAttributes() 返回具有在当前字符上定义的属性的映射。 |
abstract int |
getRunLimit() 返回关于包含当前字符的所有属性的运行后第一个字符的索引。 |
abstract int |
getRunLimit(AttributedCharacterIterator.Attribute attribute) 返回关于包含当前字符的给定 |
abstract int |
getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes) 返回关于包含当前字符的给定 |
abstract int |
getRunStart(AttributedCharacterIterator.Attribute attribute) 返回运行的第一个字符相对于包含当前字符的给定 |
abstract int |
getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes) 返回包含当前字符的给定 |
abstract int |
getRunStart() 返回运行的第一个字符相对于包含当前字符的所有属性的索引。 |
继承方法(Inherited methods) |
|
|---|---|
java.text.CharacterIterator
|
|
Set<AttributedCharacterIterator.Attribute> getAllAttributeKeys ()
返回迭代器文本范围中定义的所有属性的键。 如果没有定义属性,则该集合为空。
| 返回(Returns) | |
|---|---|
Set<AttributedCharacterIterator.Attribute> |
|
Object getAttribute (AttributedCharacterIterator.Attribute attribute)
返回当前字符的名称attribute的值。 如果attribute则返回null 。
| 参数(Parameters) | |
|---|---|
attribute |
AttributedCharacterIterator.Attribute
|
| 返回(Returns) | |
|---|---|
Object |
|
Map<AttributedCharacterIterator.Attribute, Object> getAttributes ()
返回具有在当前字符上定义的属性的映射。
| 返回(Returns) | |
|---|---|
Map<AttributedCharacterIterator.Attribute, Object> |
|
int getRunLimit ()
返回关于包含当前字符的所有属性的运行后第一个字符的索引。
任何具有相同属性(相同的一组属性/值对)的连续文本段如果已将这些属性分别提供给这些文本段,则将其视为单独运行。
| 返回(Returns) | |
|---|---|
int |
|
int getRunLimit (AttributedCharacterIterator.Attribute attribute)
返回关于包含当前字符的给定 attribute运行后的第一个字符的索引。
| 参数(Parameters) | |
|---|---|
attribute |
AttributedCharacterIterator.Attribute
|
| 返回(Returns) | |
|---|---|
int |
|
int getRunLimit (Set<? extends AttributedCharacterIterator.Attribute> attributes)
返回关于包含当前字符的给定 attributes运行后的第一个字符的索引。
| 参数(Parameters) | |
|---|---|
attributes |
Set
|
| 返回(Returns) | |
|---|---|
int |
|
int getRunStart (AttributedCharacterIterator.Attribute attribute)
返回相对于包含当前字符的给定 attribute运行的第一个字符的索引。
| 参数(Parameters) | |
|---|---|
attribute |
AttributedCharacterIterator.Attribute
|
| 返回(Returns) | |
|---|---|
int |
|
int getRunStart (Set<? extends AttributedCharacterIterator.Attribute> attributes)
返回包含当前字符的给定 attributes运行的第一个字符的索引。
| 参数(Parameters) | |
|---|---|
attributes |
Set
|
| 返回(Returns) | |
|---|---|
int |
|
int getRunStart ()
返回运行的第一个字符相对于包含当前字符的所有属性的索引。
任何具有相同属性(相同的一组属性/值对)的连续文本段如果已将这些属性分别提供给这些文本段,则将其视为单独运行。
| 返回(Returns) | |
|---|---|
int |
|