public class AbstractDocument.BranchElement extends AbstractDocument.AbstractElement
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为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返回接收的孩子。
|
boolean |
getAllowsChildren()
如果接收器允许孩子返回真的。
|
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 -偏移> = 0
public boolean isLeaf()
public boolean getAllowsChildren()
getAllowsChildren 接口
TreeNode
getAllowsChildren 方法重写,继承类
AbstractDocument.AbstractElement
public Enumeration children()
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.