|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
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 的形式返回接收者的子節點。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。