- java.lang.Object
-
- javax.swing.text.AbstractDocument.AbstractElement
-
- javax.swing.text.AbstractDocument.BranchElement
-
- すべての実装されたインタフェース:
Serializable
,AttributeSet
,Element
,MutableAttributeSet
,TreeNode
- 含まれているクラス:
- AbstractDocument
public class AbstractDocument.BranchElement extends AbstractDocument.AbstractElement
ほかの要素を含む複合要素を実装します。警告: このクラスの直列化されたオブジェクトは、今後のSwingリリースとの互換性がなくなる予定です。 現在の直列化のサポートは、短期間の格納や、同じバージョンのSwingを実行するアプリケーション間のRMIに適しています。 1.4以降、すべてのJavaBeans™用の長期間の格納サポートが
java.beans
パッケージに追加されています。XMLEncoder
を参照してください。- 関連項目:
- 直列化された形式
-
-
ネストされたクラスのサマリー
-
インタフェース javax.swing.text.AttributeSetで宣言されたネストされたクラス/インタフェース
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
-
-
フィールドのサマリー
-
インタフェース javax.swing.text.AttributeSetで宣言されたフィールド
NameAttribute, ResolveAttribute
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 BranchElement(Element parent, AttributeSet a)
最初は子を含まない、複合要素を作成します。
-
メソッドのサマリー
すべてのメソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 Enumeration<TreeNode>
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, getAttribute, getAttributeCount, getAttributeNames, getAttributes, getChildAt, getChildCount, getDocument, getIndex, getParent, getParentElement, getResolveParent, isDefined, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParent
-
-
-
-
コンストラクタの詳細
-
BranchElement
public BranchElement(Element parent, AttributeSet a)
最初は子を含まない、複合要素を作成します。- パラメータ:
parent
- 親要素a
- 要素の属性- 導入されたバージョン:
- 1.4
-
-
メソッドの詳細
-
positionToElement
public Element positionToElement(int pos)
指定されたモデル位置を含む子要素を取得します。- パラメータ:
pos
- 位置>= 0- 戻り値:
- 要素。ない場合はnull
-
replace
public void replace(int offset, int length, Element[] elems)
コンテンツを要素の新規セットで置き換えます。- パラメータ:
offset
- 開始オフセット>= 0length
- 置き換える長さ>= 0elems
- 新規要素
-
getName
public String getName()
要素の名前を取得します。- 定義:
getName
、インタフェース:Element
- オーバーライド:
getName
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- 要素の名前
-
getStartOffset
public int getStartOffset()
要素のモデル内での開始オフセットを取得します。- 定義:
getStartOffset
、インタフェース:Element
- 定義:
getStartOffset
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- オフセット>= 0
- 関連項目:
Document
,AbstractDocument
-
getEndOffset
public int getEndOffset()
要素のモデル内での終了オフセットを取得します。- 定義:
getEndOffset
、インタフェース:Element
- 定義:
getEndOffset
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- オフセット>= 0
- 例外:
NullPointerException
- この要素に子がない場合- 関連項目:
Document
,AbstractDocument
-
getElement
public Element getElement(int index)
子要素を取得します。- 定義:
getElement
、インタフェース:Element
- 定義:
getElement
、クラス:AbstractDocument.AbstractElement
- パラメータ:
index
- 子のインデックス。0以上で、getElementCount()より小さい値- 戻り値:
- 子要素。ない場合はnull
-
getElementCount
public int getElementCount()
要素の子の数を取得します。- 定義:
getElementCount
、インタフェース:Element
- 定義:
getElementCount
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- 子の数>= 0
-
getElementIndex
public int getElementIndex(int offset)
指定されたモデル・オフセットにもっとも近い子要素インデックスを取得します。- 定義:
getElementIndex
、インタフェース:Element
- 定義:
getElementIndex
、クラス:AbstractDocument.AbstractElement
- パラメータ:
offset
- オフセット>= 0- 戻り値:
- 要素のインデックス>= 0
-
isLeaf
public boolean isLeaf()
要素が葉かどうかを調べます。
-
getAllowsChildren
public boolean getAllowsChildren()
レシーバが子を許可する場合はtrueを返します。- 定義:
getAllowsChildren
、インタフェース:TreeNode
- 定義:
getAllowsChildren
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- レシーバが子を許可する場合はtrue、そうでない場合はfalse
-
children
public Enumeration<TreeNode> children()
レシーバの子をEnumeration
として返します。- 定義:
children
、インタフェース:TreeNode
- 定義:
children
、クラス:AbstractDocument.AbstractElement
- 戻り値:
- レシーバの子
-
-