java.lang.Object
javax.swing.text.AbstractDocument.AbstractElement
- すべての実装されたインタフェース:
Serializable,AttributeSet,Element,MutableAttributeSet,TreeNode
- 直系の既知のサブクラス:
AbstractDocument.BranchElement,AbstractDocument.LeafElement
- 含まれているクラス:
- AbstractDocument
public abstract class AbstractDocument.AbstractElement extends Object implements Element, MutableAttributeSet, Serializable, TreeNode
要素の抽象部分を実装します。 デフォルトでは、要素の現在の属性セットについて不変部分を表すフィールドを保持することで、要素は属性をサポートしています。 要素自身は、MutableAttributeSetを実装します。MutableAttributeSetを使用すると、新たな不変セットを取り出してセットを変更できます。 不変セットは、ドキュメントに関連するAttributeContextにより提供されます。
警告: このクラスの直列化されたオブジェクトは、今後の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 -
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
修飾子と型メソッド説明voidaddAttribute(Object name, Object value) 要素に属性を追加します。voidaddAttributes(AttributeSet attr) 属性セットを要素に追加します。abstract Enumeration<TreeNode>children()レシーバの子をEnumerationとして返します。booleancontainsAttribute(Object name, Object value) 属性の名前と値が定義済みであるかどうかを判定します。booleancontainsAttributes(AttributeSet attrs) 要素にすべての属性が含まれているかどうかを判定します。属性セットをコピーします。voiddump(PrintStream psOut, int indentAmount) 要素階層のデバッグ表現をダンプします。abstract booleanレシーバが子を許可する場合はtrueを返します。getAttribute(Object attrName) 属性の値を取得します。int定義されている属性の個数を取得します。Enumeration<?>すべての属性の名前を取得します。要素の属性を取得します。getChildAt(int childIndex) インデックスchildIndexにある子TreeNodeを返します。intTreeNodeのレシーバが格納する子の数を返します。基盤となるモデルを取得します。abstract ElementgetElement(int index) 子要素を取得します。abstract int要素の子の数を取得します。abstract intgetElementIndex(int offset) 指定されたモデル・オフセットにもっとも近い子要素インデックスを取得します。abstract int要素のモデル内での終了オフセットを取得します。intレシーバの子の中でnodeのインデックスを返します。getName()要素の名前を返します。レシーバの親TreeNodeを返します。要素の親を取得します。解釈処理側の親を返します。abstract int要素のモデル内での開始オフセットを取得します。boolean指定された属性が定義済みであるかどうかを判定します。booleanisEqual(AttributeSet attr) 2つの属性セットが等しいかどうかを判定します。abstract booleanisLeaf()要素が葉かどうかを調べます。voidremoveAttribute(Object name) セットから属性を削除します。voidremoveAttributes(Enumeration<?> names) 要素の属性セットを削除します。voidremoveAttributes(AttributeSet attrs) 要素の属性セットを削除します。voidsetResolveParent(AttributeSet parent) 解釈処理側の親を設定します。
-
コンストラクタの詳細
-
AbstractElement
public AbstractElement(Element parent, AttributeSet a) 新しいAbstractElementを作成します。- パラメータ:
parent- 親要素a- 要素の属性- 導入されたバージョン:
- 1.4
-
-
メソッドの詳細
-
dump
public void dump(PrintStream psOut, int indentAmount) 要素階層のデバッグ表現をダンプします。- パラメータ:
psOut- 出力ストリームindentAmount- インデント・レベル>= 0
-
getAttributeCount
public int getAttributeCount()定義されている属性の個数を取得します。- 定義:
getAttributeCount、インタフェースAttributeSet- 戻り値:
- 属性の数>= 0
- 関連項目:
-
isDefined
public boolean isDefined(Object attrName) 指定された属性が定義済みであるかどうかを判定します。- 定義:
isDefined、インタフェースAttributeSet- パラメータ:
attrName- null以外の属性名- 戻り値:
- 属性が定義されている場合はtrue
- 関連項目:
-
isEqual
public boolean isEqual(AttributeSet attr) 2つの属性セットが等しいかどうかを判定します。- 定義:
isEqual、インタフェースAttributeSet- パラメータ:
attr- 比較の対象となる属性セット- 戻り値:
- 等しい場合はtrue
- 関連項目:
-
copyAttributes
public AttributeSet copyAttributes()属性セットをコピーします。- 定義:
copyAttributes、インタフェースAttributeSet- 戻り値:
- コピー
- 関連項目:
-
getAttribute
属性の値を取得します。- 定義:
getAttribute、インタフェースAttributeSet- パラメータ:
attrName- null以外の属性名- 戻り値:
- 属性値
- 関連項目:
-
getAttributeNames
public Enumeration<?> getAttributeNames()すべての属性の名前を取得します。- 定義:
getAttributeNames、インタフェースAttributeSet- 戻り値:
- 属性名の列挙
- 関連項目:
-
containsAttribute
属性の名前と値が定義済みであるかどうかを判定します。- 定義:
containsAttribute、インタフェースAttributeSet- パラメータ:
name- null以外の属性名value- 属性値- 戻り値:
- 名前と値が定義されている場合はtrue
- 関連項目:
-
containsAttributes
public boolean containsAttributes(AttributeSet attrs) 要素にすべての属性が含まれているかどうかを判定します。- 定義:
containsAttributes、インタフェースAttributeSet- パラメータ:
attrs- チェック対象の属性- 戻り値:
- 要素が属性をすべて格納している場合はtrue
- 関連項目:
-
getResolveParent
public AttributeSet getResolveParent()解釈処理側の親を返します。 オーバーライドされない場合、解釈処理側の親は、デフォルトで親要素になります。- 定義:
getResolveParent、インタフェースAttributeSet- 戻り値:
- 親からの属性。ない場合は
null - 関連項目:
-
addAttribute
要素に属性を追加します。- 定義:
addAttribute、インタフェースMutableAttributeSet- パラメータ:
name- null以外の属性名value- 属性値- 関連項目:
-
addAttributes
public void addAttributes(AttributeSet attr) 属性セットを要素に追加します。- 定義:
addAttributes、インタフェースMutableAttributeSet- パラメータ:
attr- 追加する属性- 関連項目:
-
removeAttribute
public void removeAttribute(Object name) セットから属性を削除します。- 定義:
removeAttribute、インタフェースMutableAttributeSet- パラメータ:
name- null以外の属性名- 関連項目:
-
removeAttributes
public void removeAttributes(Enumeration<?> names) 要素の属性セットを削除します。- 定義:
removeAttributes、インタフェースMutableAttributeSet- パラメータ:
names- 属性名- 関連項目:
-
removeAttributes
public void removeAttributes(AttributeSet attrs) 要素の属性セットを削除します。- 定義:
removeAttributes、インタフェースMutableAttributeSet- パラメータ:
attrs- 属性- 関連項目:
-
setResolveParent
public void setResolveParent(AttributeSet parent) 解釈処理側の親を設定します。- 定義:
setResolveParent、インタフェースMutableAttributeSet- パラメータ:
parent- 親。ない場合はnull- 関連項目:
-
getDocument
public Document getDocument()基盤となるモデルを取得します。- 定義:
getDocument、インタフェースElement- 戻り値:
- モデル
-
getParentElement
public Element getParentElement()要素の親を取得します。- 定義:
getParentElement、インタフェースElement- 戻り値:
- 親
-
getAttributes
public AttributeSet getAttributes()要素の属性を取得します。- 定義:
getAttributes、インタフェースElement- 戻り値:
- 属性セット
-
getName
public String getName()要素の名前を返します。 -
getStartOffset
public abstract int getStartOffset()要素のモデル内での開始オフセットを取得します。- 定義:
getStartOffset、インタフェースElement- 戻り値:
- オフセット>= 0
- 関連項目:
-
getEndOffset
public abstract int getEndOffset()要素のモデル内での終了オフセットを取得します。- 定義:
getEndOffset、インタフェースElement- 戻り値:
- オフセット>= 0
- 関連項目:
-
getElement
public abstract Element getElement(int index) 子要素を取得します。- 定義:
getElement、インタフェースElement- パラメータ:
index- 子のインデックス。0以上で、getElementCount()より小さい値- 戻り値:
- 子要素
-
getElementCount
public abstract int getElementCount()要素の子の数を取得します。- 定義:
getElementCount、インタフェースElement- 戻り値:
- 子の数>= 0
-
getElementIndex
public abstract int getElementIndex(int offset) 指定されたモデル・オフセットにもっとも近い子要素インデックスを取得します。- 定義:
getElementIndex、インタフェースElement- パラメータ:
offset- オフセット>= 0- 戻り値:
- 要素のインデックス>= 0
-
isLeaf
public abstract boolean isLeaf()要素が葉かどうかを調べます。 -
getChildAt
public TreeNode getChildAt(int childIndex) インデックスchildIndexにある子TreeNodeを返します。- 定義:
getChildAt、インタフェースTreeNode- パラメータ:
childIndex- 子のインデックス- 戻り値:
- 指定されたインデックスの子ノード
-
getChildCount
public int getChildCount()TreeNodeのレシーバが格納する子の数を返します。- 定義:
getChildCount、インタフェースTreeNode- 戻り値:
TreeNodewsのレシーバが格納する子の数
-
getParent
public TreeNode getParent()レシーバの親TreeNodeを返します。 -
getIndex
public int getIndex(TreeNode node) レシーバの子の中でnodeのインデックスを返します。 レシーバがnodeを格納しない場合は、-1が返されます。 -
getAllowsChildren
public abstract boolean getAllowsChildren()レシーバが子を許可する場合はtrueを返します。- 定義:
getAllowsChildren、インタフェースTreeNode- 戻り値:
- レシーバが子を許可する場合はtrue、そうでない場合はfalse
-
children
public abstract Enumeration<TreeNode> children()レシーバの子をEnumerationとして返します。
-