- 所有已知的子接口:
MutableTreeNode
- 所有已知的实现类:
AbstractDocument.AbstractElement
,AbstractDocument.BranchElement
,AbstractDocument.LeafElement
,DefaultMutableTreeNode
,DefaultStyledDocument.SectionElement
,HTMLDocument.BlockElement
,HTMLDocument.RunElement
,JTree.DynamicUtilTreeNode
public interface TreeNode
-
方法总结
修饰符和类型方法描述Enumeration<? extends TreeNode>
children()
将接收器的子级作为Enumeration
返回。boolean
如果接收者允许子级,则返回 true。getChildAt
(int childIndex) 返回索引childIndex
处的子节点TreeNode
。int
返回接收者包含的孩子TreeNode
的数量。int
返回接收者孩子中node
的索引。返回接收器的父节点TreeNode
。boolean
isLeaf()
如果接收者是叶子,则返回 true。
-
方法详情
-
getChildAt
返回索引childIndex
处的子节点TreeNode
。- 参数:
childIndex
- 孩子的索引- 返回:
- 给定索引处的子节点
-
getChildCount
int getChildCount()返回接收者包含的孩子TreeNode
的数量。- 返回:
- 接收者包含的子级数量
-
getParent
TreeNode getParent()返回接收器的父节点TreeNode
。- 返回:
- 接收者的父级
-
getIndex
返回接收者孩子中node
的索引。如果接收器不包含node
,将返回 -1。- 参数:
node
- 要查找的节点- 返回:
- 指定节点索引
-
getAllowsChildren
boolean getAllowsChildren()如果接收者允许子级,则返回 true。- 返回:
- 接收器是否允许儿童
-
isLeaf
boolean isLeaf()如果接收者是叶子,则返回 true。- 返回:
- 接收者是否是叶子
-
children
Enumeration <? extends TreeNode > children()将接收器的子级作为Enumeration
返回。- 返回:
-
接收者的孩子作为
Enumeration
-