public class AbstractDocument.BranchElement extends AbstractDocument.AbstractElement
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttributeNameAttribute, ResolveAttribute| Constructor and Description |
|---|
BranchElement(Element parent, AttributeSet a)
构造最初不包含子项的复合元素。
|
| Modifier and Type | Method and Description |
|---|---|
Enumeration |
children()
作为
Enumeration返回接收者的
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()
将元素转换为字符串。
|
addAttribute, addAttributes, containsAttribute, containsAttributes, copyAttributes, dump, getAttribute, getAttributeCount, getAttributeNames, getAttributes, getChildAt, getChildCount, getDocument, getIndex, getParent, getParentElement, getResolveParent, isDefined, isEqual, removeAttribute, removeAttributes, removeAttributes, setResolveParentpublic BranchElement(Element parent, AttributeSet a)
parent - 父元素
a - 元素的属性
public Element positionToElement(int pos)
pos - 位置> = 0
public void replace(int offset,
int length,
Element[] elems)
offset - 起始偏移量> = 0
length - 要替换的长度= 0
elems - 新元素
public String getName()
getName在界面
Element
getName在
AbstractDocument.AbstractElement类
public int getStartOffset()
getStartOffset在界面
Element
getStartOffset在
AbstractDocument.AbstractElement
Document , AbstractDocument
public int getEndOffset()
getEndOffset在界面
Element
getEndOffset在
AbstractDocument.AbstractElement
NullPointerException - 如果这个元素没有孩子
Document , AbstractDocument
public Element getElement(int index)
getElement在接口
Element
getElement在
AbstractDocument.AbstractElement
index - 子索引> = 0 && <getElementCount()
public int getElementCount()
getElementCount在界面
Element
getElementCount在
AbstractDocument.AbstractElement
public int getElementIndex(int offset)
getElementIndex在界面
Element
getElementIndex在
AbstractDocument.AbstractElement
offset - offset> = 0
public boolean isLeaf()
public boolean getAllowsChildren()
getAllowsChildren在接口
TreeNode
getAllowsChildren在类
AbstractDocument.AbstractElement
public Enumeration children()
Enumeration形式返回接收者的
Enumeration 。
children在接口
TreeNode
children在
AbstractDocument.AbstractElement
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.