|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Object | +--javax.swing.text.StringContent
比較的小さなドキュメントおよびデバッグには便利な、強引な実装である AbstractDocument.Content インタフェースの実装です。これは、文字コンテンツを単純な文字配列として管理します。これも効率的ではありません。
代わりに、ギャップバッファまたはピーステーブルの実装を使うことをお勧めします。このバッファはサイズが大きくなりません。
警告:
このクラスの直列化されたオブジェクトは、今後の Swing のリリースとは互換性を持ちません。現在の直列化サポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。1.4 では、すべての JavaBeansTM の長期運用サポートが、 java.beans パッケージに追加されました。XMLEncoder を参照してください。
| コンストラクタの概要 | |
StringContent()
新しい StringContent オブジェクトを作成します。 |
|
StringContent(int initialLength)
指定された初期サイズで新しい StringContent オブジェクトを作成します。 |
|
| メソッドの概要 | |
Position |
createPosition(int offset)
コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。 |
void |
getChars(int where,
int len,
Segment chars)
コンテンツの一部を取り出します。 |
protected Vector |
getPositionsInRange(Vector v,
int offset,
int length)
offset 〜 offset + length の範囲にある位置に対応する UndoPosRef のインスタンスを含むベクタを返します。 |
String |
getString(int where,
int len)
コンテンツの一部を取り出します。 |
UndoableEdit |
insertString(int where,
String str)
コンテンツに文字列を挿入します。 |
int |
length()
コンテンツの長さを返します。 |
UndoableEdit |
remove(int where,
int nitems)
コンテンツの一部を削除します。 |
protected void |
updateUndoPositions(Vector positions)
positions のすべての UndoPosRef インスタンスの位置をリセットします。
|
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
public StringContent()
public StringContent(int initialLength)
initialLength - 初期サイズ| メソッドの詳細 |
public int length()
AbstractDocument.Content 内の lengthAbstractDocument.Content.length()
public UndoableEdit insertString(int where,
String str)
throws BadLocationException
AbstractDocument.Content 内の insertStringwhere - 開始位置 >= 0 && < length()str - 挿入する null 以外の文字列
BadLocationException - 指定された位置が無効な場合AbstractDocument.Content.insertString(int, java.lang.String)
public UndoableEdit remove(int where,
int nitems)
throws BadLocationException
AbstractDocument.Content 内の removewhere - 開始位置 >= 0nitems - 削除対象の文字数 >= 0
BadLocationException - 指定された位置が無効な場合AbstractDocument.Content.remove(int, int)
public String getString(int where,
int len)
throws BadLocationException
AbstractDocument.Content 内の getStringwhere - 開始位置 >= 0len - 取り出す長さ >= 0
BadLocationException - 指定された位置が無効な場合AbstractDocument.Content.getString(int, int)
public void getChars(int where,
int len,
Segment chars)
throws BadLocationException
AbstractDocument.Content 内の getCharswhere - 開始位置 >= 0len - 検索対象の文字数 >= 0chars - 文字を返す先の Segment オブジェクト
BadLocationException - 指定された位置が無効な場合AbstractDocument.Content.getChars(int, int, javax.swing.text.Segment)
public Position createPosition(int offset)
throws BadLocationException
AbstractDocument.Content 内の createPositionoffset - 位置を作成するオフセット >= 0
BadLocationException - 指定された位置が無効な場合
protected Vector getPositionsInRange(Vector v,
int offset,
int length)
offset 〜 offset + length の範囲にある位置に対応する UndoPosRef のインスタンスを含むベクタを返します。v が null ではない場合、一致する位置がそこに配置されます。結果の位置を持つベクタが返されます。
これは内部での使用を目的としていて、一般にはサブクラスを対象にしていません。
v - 使用するベクタ。null の場合は新しいベクタが作成されるoffset - 開始オフセット >= 0length - 長さ >= 0
protected void updateUndoPositions(Vector positions)
positions のすべての UndoPosRef インスタンスの位置をリセットします。
これは内部での使用を目的としていて、一般にはサブクラスを対象にしていません。
positions - インスタンスの位置
|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
Java、Java 2D、および JDBC は米国ならびにその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.