Java プラットフォーム 1.2

javax.swing.text
クラス AbstractDocument.BranchElement

java.lang.Object
  |
  +--javax.swing.text.AbstractDocument.AbstractElement
        |
        +--javax.swing.text.AbstractDocument.BranchElement
直接の既知のサブクラス:
DefaultStyledDocument.SectionElement, HTMLDocument.BlockElement

public class AbstractDocument.BranchElement
extends AbstractDocument.AbstractElement

他の要素を含む複合要素を実装します。

警告: このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。

関連項目:
直列化された形式

コンストラクタの概要
AbstractDocument.BranchElement(Element parent, AttributeSet a)
          初期状態では子を持たない複合要素を構築します。
 
メソッドの概要
 Enumeration children()
          受信側の子を Enumeration として返します。
 boolean getAllowsChildren()
          受信側が子を許可する場合に true を返します。
 Element getElement(int index)
          子要素を取得します。
 int getElementCount()
          要素の子の数を取得します。
 int getElementIndex(int offset)
          指定されたモデル内オフセットにもっとも近い、子要素のインデックスを取得します。
 int getEndOffset()
          要素のモデルにおける終了オフセットを取得します。
 String getName()
          要素の名前を取得します。
 int getStartOffset()
          要素のモデルにおける開始オフセットを取得します。
 boolean isLeaf()
          要素が葉であるかどうかを判定します。
 Element positionToElement(int pos)
          指定されたモデル位置に含まれる子要素を取得します。
 void replace(int offset, int length, Element[] elems)
          内容を新しい要素セットで置き換えます。
 String toString()
          要素を文字列に変換します。
 
クラス javax.swing.text.AbstractDocument.AbstractElement から継承したメソッド
addAttribute, addAttributes, containsAttribute, containsAttributes, copyAttributes, dump, finalize, getAttribute, getAttributeCount, getAttributeNames, getAttributes, getChildAt, getChildCount, getDocument, getIndex, getParent, getParentElement, getResolveParent, isDefined, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParent
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

AbstractDocument.BranchElement

public AbstractDocument.BranchElement(Element parent,
                                      AttributeSet a)
初期状態では子を持たない複合要素を構築します。
パラメータ:
parent - 親要素
a - 要素の属性
メソッドの詳細

positionToElement

public Element positionToElement(int pos)
指定されたモデル位置に含まれる子要素を取得します。
パラメータ:
pos - 位置 >= 0
戻り値:
要素。ない場合は null

replace

public void replace(int offset,
                    int length,
                    Element[] elems)
内容を新しい要素セットで置き換えます。
パラメータ:
offset - 開始オフセット >= 0
length - 置き換える長さ >= 0
elems - 新しい要素

toString

public String toString()
要素を文字列に変換します。
戻り値:
文字列
オーバーライド:
クラス Object 内の toString

getName

public String getName()
要素の名前を取得します。
戻り値:
要素の名前
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getName

getStartOffset

public int getStartOffset()
要素のモデルにおける開始オフセットを取得します。
戻り値:
オフセット >= 0
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getStartOffset

getEndOffset

public int getEndOffset()
要素のモデルにおける終了オフセットを取得します。
戻り値:
オフセット >= 0
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getEndOffset

getElement

public Element getElement(int index)
子要素を取得します。
パラメータ:
index - 子のインデックス >= 0 && < getElementCount()
戻り値:
子要素。ない場合は null
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getElement

getElementCount

public int getElementCount()
要素の子の数を取得します。
戻り値:
子の数 >= 0
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getElementCount

getElementIndex

public int getElementIndex(int offset)
指定されたモデル内オフセットにもっとも近い、子要素のインデックスを取得します。
パラメータ:
offset - オフセット >= 0
戻り値:
要素のインデックス >= 0
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getElementIndex

isLeaf

public boolean isLeaf()
要素が葉であるかどうかを判定します。
戻り値:
葉の場合は true
オーバーライド:
クラス AbstractDocument.AbstractElement 内の isLeaf

getAllowsChildren

public boolean getAllowsChildren()
受信側が子を許可する場合に true を返します。
オーバーライド:
クラス AbstractDocument.AbstractElement 内の getAllowsChildren

children

public Enumeration children()
受信側の子を Enumeration として返します。
オーバーライド:
クラス AbstractDocument.AbstractElement 内の children

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.