- 既知のすべての実装クラス:
- GapContent,- StringContent
- 含まれているクラス:
- AbstractDocument
public static interface AbstractDocument.Content
編集可能な文字のシーケンスを示すインタフェースです。 実装では、変更がUndoableEditの実装を返すかどうかを反映する、履歴メカニズムをサポートしてもしなくてもかまいません。 
- 関連項目:
- AbstractDocument
- 
メソッドのサマリー修飾子と型 メソッド 説明 PositioncreatePosition(int offset)コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。voidgetChars(int where, int len, Segment txt)文字のシーケンスを取得して、セグメントにコピーします。StringgetString(int where, int len)シーケンスに含まれる文字列を返します。UndoableEditinsertString(int where, String str)シーケンスに文字列を挿入します。intlength()文字シーケンスの、現在の長さです。UndoableEditremove(int where, int nitems)シーケンスの一部を削除します。
- 
メソッドの詳細- 
createPositionPosition createPosition(int offset) throws BadLocationExceptionコンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。- パラメータ:
- offset- コンテンツのオフセット>= 0
- 戻り値:
- 位置
- 例外:
- BadLocationException- オフセットが無効な場合
 
- 
lengthint length()文字シーケンスの、現在の長さです。- 戻り値:
- 長さ>= 0
 
- 
insertStringUndoableEdit insertString(int where, String str) throws BadLocationExceptionシーケンスに文字列を挿入します。- パラメータ:
- where- 挿入するシーケンスまでのオフセット>= 0
- str- 挿入する文字列
- 戻り値:
- 実装が履歴メカニズムをサポートしている場合は、Editの実装への参照が返される。そうでない場合はnull
- 例外:
- BadLocationException- 引数によって指定された領域が文字のシーケンスに含まれない場合にスローされる
 
- 
removeUndoableEdit remove(int where, int nitems) throws BadLocationExceptionシーケンスの一部を削除します。- パラメータ:
- where- 挿入するシーケンスまでのオフセット>= 0。
- nitems- 削除対象となるシーケンス内の項目の数>= 0。
- 戻り値:
- 実装が履歴メカニズムをサポートしている場合は、Editの実装への参照が返される。それ以外の場合はnull。
- 例外:
- BadLocationException- 引数によって指定された領域が文字のシーケンスに含まれない場合にスローされる。
 
- 
getStringString getString(int where, int len) throws BadLocationExceptionシーケンスに含まれる文字列を返します。- パラメータ:
- where- 取得するシーケンスまでのオフセット>= 0。
- len- コピーする文字数>= 0。
- 戻り値:
- 文字列
- 例外:
- BadLocationException- 引数によって指定された領域が文字のシーケンスに含まれない場合にスローされる。
 
- 
getCharsvoid getChars(int where, int len, Segment txt) throws BadLocationException文字のシーケンスを取得して、セグメントにコピーします。- パラメータ:
- where- 開始オフセット>= 0
- len- 文字数>= 0
- txt- コピー先の位置
- 例外:
- BadLocationException- 引数によって指定された領域が文字のシーケンスに含まれない場合にスローされる。
 
 
-