|
Java プラットフォーム 1.2 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Object | +--javax.swing.text.StringContent
比較的小さなドキュメントおよびデバッグには便利な、粗野な実装である AbstractDocument.Content インタフェースの実装です。これは、文字コンテンツを単純な文字配列として管理します。これも効率的ではありません。
代わりに、ギャップバッファまたはピーステーブルの実装を使うことをお勧めします。このバッファはサイズが大きくなりません。
警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
| コンストラクタの概要 | |
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.length()
public UndoableEdit insertString(int where,
String str)
throws BadLocationException
where - 開始位置 >= 0 && < length()str - 挿入する null 以外の文字列AbstractDocument.Content.insertString(int, java.lang.String)
public UndoableEdit remove(int where,
int nitems)
throws BadLocationException
where - 開始位置 >= 0nitems - 削除する文字数 >= 0AbstractDocument.Content.remove(int, int)
public String getString(int where,
int len)
throws BadLocationException
where - 開始位置 >= 0len - 取り出す長さ >= 0AbstractDocument.Content.getString(int, int)
public void getChars(int where,
int len,
Segment chars)
throws BadLocationException
where - 開始位置 >= 0len - 取り出す文字数 >= 0chars - 文字を返す Segment オブジェクトAbstractDocument.Content.getChars(int, int, javax.swing.text.Segment)
public Position createPosition(int offset)
throws BadLocationException
offset - 位置を作成するオフセット >= 0
protected Vector getPositionsInRange(Vector v,
int offset,
int length)
offset 〜 offset + length の範囲にある位置に対応する UndoPosRef のインスタンスを含むベクトルを返します。v が null ではない場合、一致する位置がそこに配置されます。結果の位置を持つベクトルが返されます。v - 使用するベクトル。null の場合は新しいベクトルが作成されるoffset - 開始オフセット >= 0length - 長さ >= 0protected void updateUndoPositions(Vector positions)
positions のすべての UndoPosRef インスタンスの位置をリセットします。positions - インスタンスの位置
|
Java プラットフォーム 1.2 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||