今天写安卓程序见到一个方法getChildAt();不懂其用边去百度搜索了一下,看到了它的api,细致看看原来是在接口里面如今我把这个api贴给大家共享假设是操作xml我认为用这个非常方便
public interface TreeNode
定义能够用作 JTree 中树节点的对象所需的要求。
重写 equals 的 TreeNode 的实现通常也须要重写 hashCode。有关很多其它信息,请參阅 TreeModel。
有关使用树节点的很多其它信息和演示样例,请參阅 The Java Tutorial 中的 How to Use Tree Nodes。
| 方法摘要 | |
|---|---|
Enumeration |
children() 以 Enumeration 的形式返回接收者的子节点。 |
boolean |
getAllowsChildren() 假设接收者同意有子节点,则返回 true。 |
TreeNode |
getChildAt(int childIndex) 返回索引 childIndex 位置的子 TreeNode。 |
int |
getChildCount() 返回接收者包括的子 TreeNode 数。 |
int |
getIndex(TreeNode node) 返回接收者子节点中的 node 的索引。 |
TreeNode |
getParent() 返回接收者的父 TreeNode。 |
boolean |
isLeaf() 假设接收者是一个叶节点,则返回 true。 |
| 方法具体信息 |
|---|
TreeNode getChildAt(int childIndex)
childIndex 位置的子 TreeNode。
int getChildCount()
TreeNode 数。
TreeNode getParent()
TreeNode。
int getIndex(TreeNode node)
node 的索引。假设接收者不包括 node,则返回 -1。
boolean getAllowsChildren()
boolean isLeaf()
Enumeration children()
Enumeration 的形式返回接收者的子节点。原文:http://www.cnblogs.com/lxjshuju/p/7395157.html