📄 defaultmutabletreenode.html
字号:
this node in depth-first order.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getAllowsChildren()">getAllowsChildren</A></B>()</CODE><BR> Returns true if this node is allowed to have children.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getChildAfter(javax.swing.tree.TreeNode)">getChildAfter</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aChild)</CODE><BR> Returns the child in this node's child array that immediately follows <code>aChild</code>, which must be a child of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getChildAt(int)">getChildAt</A></B>(int index)</CODE><BR> Returns the child at the specified index in this node's child array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getChildBefore(javax.swing.tree.TreeNode)">getChildBefore</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aChild)</CODE><BR> Returns the child in this node's child array that immediately precedes <code>aChild</code>, which must be a child of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getChildCount()">getChildCount</A></B>()</CODE><BR> Returns the number of children of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getDepth()">getDepth</A></B>()</CODE><BR> Returns the depth of the tree rooted at this node -- the longest distance from this node to a leaf.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getFirstChild()">getFirstChild</A></B>()</CODE><BR> Returns this node's first child.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getFirstLeaf()">getFirstLeaf</A></B>()</CODE><BR> Finds and returns the first leaf that is a descendant of this node -- either this node or its first child's first leaf.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getIndex(javax.swing.tree.TreeNode)">getIndex</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aChild)</CODE><BR> Returns the index of the specified child in this node's child array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getLastChild()">getLastChild</A></B>()</CODE><BR> Returns this node's last child.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getLastLeaf()">getLastLeaf</A></B>()</CODE><BR> Finds and returns the last leaf that is a descendant of this node -- either this node or its last child's last leaf.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getLeafCount()">getLeafCount</A></B>()</CODE><BR> Returns the total number of leaves that are descendants of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getLevel()">getLevel</A></B>()</CODE><BR> Returns the number of levels above this node -- the distance from the root to this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getNextLeaf()">getNextLeaf</A></B>()</CODE><BR> Returns the leaf after this node or null if this node is the last leaf in the tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getNextNode()">getNextNode</A></B>()</CODE><BR> Returns the node that follows this node in a preorder traversal of this node's tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getNextSibling()">getNextSibling</A></B>()</CODE><BR> Returns the next sibling of this node in the parent's children array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getParent()">getParent</A></B>()</CODE><BR> Returns this node's parent or null if this node has no parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getPath()">getPath</A></B>()</CODE><BR> Returns the path from the root, to get to this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getPathToRoot(javax.swing.tree.TreeNode, int)">getPathToRoot</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aNode, int depth)</CODE><BR> Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getPreviousLeaf()">getPreviousLeaf</A></B>()</CODE><BR> Returns the leaf before this node or null if this node is the first leaf in the tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getPreviousNode()">getPreviousNode</A></B>()</CODE><BR> Returns the node that precedes this node in a preorder traversal of this node's tree.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getPreviousSibling()">getPreviousSibling</A></B>()</CODE><BR> Returns the previous sibling of this node in the parent's children array.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getRoot()">getRoot</A></B>()</CODE><BR> Returns the root of the tree that contains this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)">getSharedAncestor</A></B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A> aNode)</CODE><BR> Returns the nearest common ancestor to this node and <code>aNode</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getSiblingCount()">getSiblingCount</A></B>()</CODE><BR> Returns the number of siblings of this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/lang/Object.html">Object</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getUserObject()">getUserObject</A></B>()</CODE><BR> Returns this node's user object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/lang/Object.html">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getUserObjectPath()">getUserObjectPath</A></B>()</CODE><BR> Returns the user object path, from the root, to get to this node.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#insert(javax.swing.tree.MutableTreeNode, int)">insert</A></B>(<A HREF="../../../javax/swing/tree/MutableTreeNode.html">MutableTreeNode</A> newChild, int childIndex)</CODE><BR> Removes <code>newChild</code> from its present parent (if it has a parent), sets the child's parent to this node, and then adds the child to this node's child array at index <code>childIndex</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isLeaf()">isLeaf</A></B>()</CODE><BR> Returns true if this node has no children.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeAncestor(javax.swing.tree.TreeNode)">isNodeAncestor</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> anotherNode)</CODE><BR> Returns true if <code>anotherNode</code> is an ancestor of this node -- if it is this node, this node's parent, or an ancestor of this node's parent.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeChild(javax.swing.tree.TreeNode)">isNodeChild</A></B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> aNode)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -