public interface AttributedCharacterIterator extends CharacterIterator
AttributedCharacterIteratorは、テキストとそのテキストに関連する属性情報を、どちらも反復処理できるようにします。
属性はキーと値のペアであり、キーで識別されます。 1つの文字に対して複数の属性キーを定義することはできません。
属性の値は不変です。つまり、クライアントやストレージによって変更できません。 属性の値は常に参照渡しです。複製されることはありません。
次の場合、属性についてのランは、最大テキスト範囲です。
nullである、あるいは
null以外の同じ値を持つ。
属性セットについてのランは、それぞれのメンバー属性について上記の条件が成立する最大テキスト範囲です。
明示的な属性を指定せずにランを取得すると(すなわち、getRunStart()およびgetRunLimit()を呼び出すと)、同じ属性(同じ属性/値ペア・セット)を持つ連続したテキスト・セグメントは、属性がそれらのテキスト・セグメントに個別に与えられている場合、別個のランとして扱われます。
返されるインデックスは、イテレータの範囲に限定されます。
返される属性情報は、現在の文字を保持するランに限定されます。
属性キーは、AttributedCharacterIterator.Attributeおよびそのサブクラス(TextAttributeなど)のインスタンスです。
AttributedCharacterIterator.Attribute, TextAttribute, AttributedString, Annotation| 修飾子と型 | インタフェース | 説明 |
|---|---|---|
static class |
AttributedCharacterIterator.Attribute |
テキスト属性の識別に使用する属性キーを定義します。
|
DONE| 修飾子と型 | メソッド | 説明 |
|---|---|---|
Set<AttributedCharacterIterator.Attribute> |
getAllAttributeKeys() |
イテレータのテキスト範囲で定義されたすべての属性のキーを返します。
|
Object |
getAttribute(AttributedCharacterIterator.Attribute attribute) |
現在の文字について指定された
attributeの値を返します。 |
Map<AttributedCharacterIterator.Attribute,Object> |
getAttributes() |
現在の文字に定義された属性を持つマップを返します。
|
int |
getRunLimit() |
現在の文字を保持するすべての属性について、ランの次に来る先頭文字のインデックスを返します。
|
int |
getRunLimit(AttributedCharacterIterator.Attribute attribute) |
現在の文字を保持する指定された
attributeについて、ランの次に来る先頭文字のインデックスを返します。 |
int |
getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes) |
現在の文字を保持する指定された
attributesについて、ランの次に来る先頭文字のインデックスを返します。 |
int |
getRunStart() |
現在の文字を保持するすべての属性について、ランの先頭文字のインデックスを返します。
|
int |
getRunStart(AttributedCharacterIterator.Attribute attribute) |
現在の文字を保持する指定された
attributeについて、ランの先頭文字のインデックスを返します。 |
int |
getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes) |
現在の文字を保持する指定された
attributesについて、ランの先頭文字のインデックスを返します。 |
clone, current, first, getBeginIndex, getEndIndex, getIndex, last, next, previous, setIndexint getRunStart()
同じ属性(同じ属性/値ペア・セット)を持つ連続したテキスト・セグメントは、属性がそれらのテキスト・セグメントに個別に与えられている場合、別個のランとして扱われます。
int getRunStart(AttributedCharacterIterator.Attribute attribute)
attributeについて、ランの先頭文字のインデックスを返します。attribute - 目的の属性。int getRunStart(Set<? extends AttributedCharacterIterator.Attribute> attributes)
attributesについて、ランの先頭文字のインデックスを返します。attributes - 目的の属性のセット。int getRunLimit()
同じ属性(同じ属性/値ペア・セット)を持つ連続したテキスト・セグメントは、属性がそれらのテキスト・セグメントに個別に与えられている場合、別個のランとして扱われます。
int getRunLimit(AttributedCharacterIterator.Attribute attribute)
attributeについて、ランの次に来る先頭文字のインデックスを返します。attribute - 目的の属性int getRunLimit(Set<? extends AttributedCharacterIterator.Attribute> attributes)
attributesについて、ランの次に来る先頭文字のインデックスを返します。attributes - 目的の属性のセットMap<AttributedCharacterIterator.Attribute,Object> getAttributes()
Object getAttribute(AttributedCharacterIterator.Attribute attribute)
attributeの値を返します。 attributeが定義されていない場合はnullを返します。 attribute - 目的の属性attributeの値、またはnullSet<AttributedCharacterIterator.Attribute> getAllAttributeKeys()
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。