-
- All Known Subinterfaces:
-
MutableTreeNode
- 所有已知实现类:
-
AbstractDocument.AbstractElement,AbstractDocument.BranchElement,AbstractDocument.LeafElement,DefaultMutableTreeNode,DefaultStyledDocument.SectionElement,HTMLDocument.BlockElement,HTMLDocument.RunElement,JTree.DynamicUtilTreeNode
public interface TreeNode定义可以用作JTree中的树节点的对象的要求。覆盖
equals的TreeNode实现通常也需要覆盖hashCode。 有关详细信息,请参阅TreeModel。 有关使用树节点的更多信息和示例,请参阅Java Tutorial中的 How to Use Tree Nodes 。
-
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 Enumeration<? extends TreeNode>children()作为一个Enumeration返回接收者的Enumeration。booleangetAllowsChildren()如果接收器允许孩子,则返回true。TreeNodegetChildAt(int childIndex)返回小孩TreeNode,索引号为childIndex。intgetChildCount()返回接收器包含的子数TreeNode。intgetIndex(TreeNode node)返回接收儿童中的node的索引。TreeNodegetParent()返回接收者的父母TreeNode。booleanisLeaf()如果接收者是叶子,则返回true。
-
-
-
方法详细信息
-
getChildAt
TreeNode getChildAt(int childIndex)
返回小孩TreeNode,索引号为childIndex。- 参数
-
childIndex- 小孩的索引 - 结果
- 给定索引的子节点
-
getChildCount
int getChildCount()
返回接收器包含的子数TreeNode。- 结果
- 接收器包含的孩子数量
-
getParent
TreeNode getParent()
返回接收者的父母TreeNode。- 结果
- 接收者的父母
-
getIndex
int getIndex(TreeNode node)
返回接收儿童中的node的索引。 如果接收方不包含node,则返回-1。- 参数
-
node- 要被loked的节点 - 结果
- 指定节点的索引
-
getAllowsChildren
boolean getAllowsChildren()
如果接收器允许孩子,则返回true。- 结果
- 接收器是否允许儿童
-
isLeaf
boolean isLeaf()
如果接收者是叶子,则返回true。- 结果
- 接收者是否是叶
-
children
Enumeration<? extends TreeNode> children()
作为一个Enumeration返回接收者的Enumeration。- 结果
-
接收者的孩子为
Enumeration
-
-