public class AbstractDocument.LeafElement extends AbstractDocument.AbstractElement
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看XMLEncoder。
Element
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttributeNameAttribute, ResolveAttribute| Constructor and Description |
|---|
LeafElement(Element parent, AttributeSet a, int offs0, int offs1)
构造一个表示文档中内容的元素(没有孩子)。
|
| Modifier and Type | Method and Description |
|---|---|
Enumeration |
children()
作为一个
Enumeration返回接收的孩子。
|
boolean |
getAllowsChildren()
如果接收器允许孩子返回真的。
|
Element |
getElement(int index)
获取子元素。
|
int |
getElementCount()
返回子元素的数量。
|
int |
getElementIndex(int pos)
获取与给定模型偏移量最接近的子元素索引。
|
int |
getEndOffset()
获取元素的模型中的结束偏移量。
|
String |
getName()
获取元素名称。
|
int |
getStartOffset()
获取元素的模型中的起始偏移量。
|
boolean |
isLeaf()
检查元素是否是一个叶子。
|
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 LeafElement(Element parent, AttributeSet a, int offs0, int offs1)
parent -父元素
a -元素的属性
offs0的起始偏移> = 0
offs1的结束偏移量> = offs0
public int getStartOffset()
getStartOffset 接口
Element
getStartOffset 方法重写,继承类
AbstractDocument.AbstractElement
Document,
AbstractDocument
public int getEndOffset()
getEndOffset 接口
Element
getEndOffset 方法重写,继承类
AbstractDocument.AbstractElement
Document,
AbstractDocument
public String getName()
getName 接口
Element
getName 方法重写,继承类
AbstractDocument.AbstractElement
public int getElementIndex(int pos)
getElementIndex 接口
Element
getElementIndex 方法重写,继承类
AbstractDocument.AbstractElement
pos -偏移> = 0
public Element getElement(int index)
getElement 接口
Element
getElement 方法重写,继承类
AbstractDocument.AbstractElement
index -孩子指数> = 0和<getelementcount()
public int getElementCount()
getElementCount 接口
Element
getElementCount 方法重写,继承类
AbstractDocument.AbstractElement
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.