|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjava.text.AttributedString
public class AttributedString
テキストとそのテキストに関連する属性情報を保持します。テキストを読み取るユーザが、AttributedCharacterIterator インタフェース経由で属性付きテキストにアクセスする必要がある場合、このクラスを実際のデータストレージとして使用できます。
AttributedCharacterIterator,
Annotation| コンストラクタの概要 | |
|---|---|
AttributedString(AttributedCharacterIterator text)
指定された AttributedCharacterIterator が表現する属性付きテキストを持つ、AttributedString インスタンスを構築します。 |
|
AttributedString(AttributedCharacterIterator text,
int beginIndex,
int endIndex)
指定された AttributedCharacterIterator が表現する属性付きテキストの部分範囲を持つ AttributedString インスタンスを構築します。 |
|
AttributedString(AttributedCharacterIterator text,
int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
指定された AttributedCharacterIterator が表現する属性付きテキストの部分範囲を持つ AttributedString インスタンスを構築します。 |
|
AttributedString(String text)
指定されたテキストを持つ AttributedString インスタンスを構築します。 |
|
AttributedString(String text,
Map<? extends AttributedCharacterIterator.Attribute,?> attributes)
指定されたテキストと属性を持つ AttributedString インスタンスを構築します。 |
|
| メソッドの概要 | |
|---|---|
void |
addAttribute(AttributedCharacterIterator.Attribute attribute,
Object value)
属性を文字列全体に追加します。 |
void |
addAttribute(AttributedCharacterIterator.Attribute attribute,
Object value,
int beginIndex,
int endIndex)
属性を文字列の部分範囲に追加します。 |
void |
addAttributes(Map<? extends AttributedCharacterIterator.Attribute,?> attributes,
int beginIndex,
int endIndex)
一連の属性を文字列の部分範囲に追加します。 |
AttributedCharacterIterator |
getIterator()
この文字列の内容全体にアクセスできる AttributedCharacterIterator インスタンスを作成します。 |
AttributedCharacterIterator |
getIterator(AttributedCharacterIterator.Attribute[] attributes)
この文字列の選択された内容にアクセスできる AttributedCharacterIterator インスタンスを作成します。 |
AttributedCharacterIterator |
getIterator(AttributedCharacterIterator.Attribute[] attributes,
int beginIndex,
int endIndex)
この文字列の選択された内容にアクセスできる AttributedCharacterIterator インスタンスを作成します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public AttributedString(String text)
text - この属性付き文字列のテキスト
public AttributedString(String text,
Map<? extends AttributedCharacterIterator.Attribute,?> attributes)
text - この属性付き文字列のテキストattributes - 文字列全体に適用する属性
IllegalArgumentException - テキスト長が 0 で、かつ属性パラメータが空の Map でない場合 (長さ 0 の範囲には属性を適用できない)public AttributedString(AttributedCharacterIterator text)
text - この属性付き文字列のテキスト
public AttributedString(AttributedCharacterIterator text,
int beginIndex,
int endIndex)
text - この属性付き文字列のテキストbeginIndex - 範囲の先頭文字のインデックスendIndex - 範囲の末尾文字の次の文字のインデックス
IllegalArgumentException - beginIndex と endIndex で指定された部分範囲がテキストの範囲外にある場合Annotation
public AttributedString(AttributedCharacterIterator text,
int beginIndex,
int endIndex,
AttributedCharacterIterator.Attribute[] attributes)
text - この属性付き文字列のテキストbeginIndex - 範囲の先頭文字のインデックスendIndex - 範囲の末尾文字の次の文字のインデックスattributes - テキストから抽出する属性。null が指定された場合、利用可能なすべての属性が使用される
IllegalArgumentException - beginIndex と endIndex で指定された部分範囲がテキストの範囲外にある場合Annotation| メソッドの詳細 |
|---|
public void addAttribute(AttributedCharacterIterator.Attribute attribute,
Object value)
attribute - 属性のキーvalue - 属性の値。null も指定可能
IllegalArgumentException - AttributedString の長さが 0 の場合 (長さ 0 の範囲には属性を適用できない)
public void addAttribute(AttributedCharacterIterator.Attribute attribute,
Object value,
int beginIndex,
int endIndex)
attribute - 属性のキーvalue - 属性の値。null も指定可能beginIndex - 範囲の先頭文字のインデックスendIndex - 範囲の末尾文字の次の文字のインデックス
IllegalArgumentException - beginIndex が 0 より小さい場合、endIndex が文字列長より大きい場合、あるいは beginIndex と endIndex で定義される文字列の部分範囲が空になる場合
public void addAttributes(Map<? extends AttributedCharacterIterator.Attribute,?> attributes,
int beginIndex,
int endIndex)
attributes - 文字列に追加する属性beginIndex - 範囲の先頭文字のインデックスendIndex - 範囲の末尾文字の次の文字のインデックス
IllegalArgumentException - beginIndex が 0 より小さい場合、endIndex が文字列長より大きい場合、あるいは beginIndex と endIndex で定義される文字列の部分範囲が空で、属性パラメータは空の Map でない場合public AttributedCharacterIterator getIterator()
public AttributedCharacterIterator getIterator(AttributedCharacterIterator.Attribute[] attributes)
attributes - クライアントが興味を持っている属性のリスト
public AttributedCharacterIterator getIterator(AttributedCharacterIterator.Attribute[] attributes,
int beginIndex,
int endIndex)
attributes - クライアントが興味を持っている属性のリストbeginIndex - 先頭文字のインデックスendIndex - 末尾文字の次の文字のインデックス
IllegalArgumentException - beginIndex が 0 より小さい場合、endIndex が文字列長より大きい場合、あるいは beginIndex が endIndex より大きい場合
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。