java TreeNode介面

來源:互聯網
上載者:User

標籤:看到了   mod   child   有關   table   ranch   重寫   操作   method   

今天寫安卓程式見到一個方法getChildAt();不懂其用邊去百度搜尋了一下,看到了它的api,細緻看看原來是在介面裡面如今我把這個api貼給大家共用假設是操作xml我認為用這個非常方便

javax.swing.tree 
介面 TreeNode
全部已知子介面:
MutableTreeNode
全部已知實作類別:
AbstractDocument.AbstractElement, AbstractDocument.BranchElement, AbstractDocument.LeafElement, DefaultMutableTreeNode, DefaultStyledDocument.SectionElement,HTMLDocument.BlockElement, HTMLDocument.RunElement, JTree.DynamicUtilTreeNode
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。

 

方法具體資訊
getChildAt
TreeNode getChildAt(int childIndex)
返回索引  childIndex 位置的子  TreeNode

getChildCount
int getChildCount()
返回接收者包括的子  TreeNode 數。

getParent
TreeNode getParent()
返回接收者的父  TreeNode

getIndex
int getIndex(TreeNode node)
返回接收者子節點中的  node 的索引。

假設接收者不包括 node,則返回 -1。

getAllowsChildren
boolean getAllowsChildren()
假設接收者同意有子節點,則返回 true。

isLeaf
boolean isLeaf()
假設接收者是一個分葉節點,則返回 true。

children
Enumeration children()
以  Enumeration 的形式返回接收者的子節點。

java TreeNode介面

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.