⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultmutabletreenode.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anotherNode</CODE> - node to test as an ancestor of this node<DT><B>Returns:</B><DD>true if this node is a descendant of <code>anotherNode</code><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)"><CODE>isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)"><CODE>getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)</CODE></A></DL></DD></DL><HR><A NAME="isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)"><!-- --></A><H3>isNodeDescendant</H3><PRE>public boolean <B>isNodeDescendant</B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A>&nbsp;anotherNode)</PRE><DL><DD>Returns true if <code>anotherNode</code> is a descendant of this node -- if it is this node, one of this node's children, or a descendant of one of this node's children.  Note that a node is considered a descendant of itself.  If <code>anotherNode</code> is null, returns false.  This operation is at worst O(h) where h is the distance from the root to <code>anotherNode</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>anotherNode</CODE> - node to test as descendant of this node<DT><B>Returns:</B><DD>true if this node is an ancestor of <code>anotherNode</code><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeAncestor(javax.swing.tree.TreeNode)"><CODE>isNodeAncestor(javax.swing.tree.TreeNode)</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)"><CODE>getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)</CODE></A></DL></DD></DL><HR><A NAME="getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)"><!-- --></A><H3>getSharedAncestor</H3><PRE>public <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> <B>getSharedAncestor</B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A>&nbsp;aNode)</PRE><DL><DD>Returns the nearest common ancestor to this node and <code>aNode</code>. Returns null, if no such ancestor exists -- if this node and <code>aNode</code> are in different trees or if <code>aNode</code> is null.  A node is considered an ancestor of itself.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>aNode</CODE> - node to find common ancestor with<DT><B>Returns:</B><DD>nearest ancestor common to this node and <code>aNode</code>,		or null if none<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeAncestor(javax.swing.tree.TreeNode)"><CODE>isNodeAncestor(javax.swing.tree.TreeNode)</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)"><CODE>isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)</CODE></A></DL></DD></DL><HR><A NAME="isNodeRelated(javax.swing.tree.DefaultMutableTreeNode)"><!-- --></A><H3>isNodeRelated</H3><PRE>public boolean <B>isNodeRelated</B>(<A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A>&nbsp;aNode)</PRE><DL><DD>Returns true if and only if <code>aNode</code> is in the same tree as this node.  Returns false if <code>aNode</code> is null.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if <code>aNode</code> is in the same tree as this node;		false if <code>aNode</code> is null<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)"><CODE>getSharedAncestor(javax.swing.tree.DefaultMutableTreeNode)</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getRoot()"><CODE>getRoot()</CODE></A></DL></DD></DL><HR><A NAME="getDepth()"><!-- --></A><H3>getDepth</H3><PRE>public int <B>getDepth</B>()</PRE><DL><DD>Returns the depth of the tree rooted at this node -- the longest distance from this node to a leaf.  If this node has no children, returns 0.  This operation is much more expensive than <code>getLevel()</code> because it must effectively traverse the entire tree rooted at this node.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the depth of the tree whose root is this node<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getLevel()"><CODE>getLevel()</CODE></A></DL></DD></DL><HR><A NAME="getLevel()"><!-- --></A><H3>getLevel</H3><PRE>public int <B>getLevel</B>()</PRE><DL><DD>Returns the number of levels above this node -- the distance from the root to this node.  If this node is the root, returns 0.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of levels above this node<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#getDepth()"><CODE>getDepth()</CODE></A></DL></DD></DL><HR><A NAME="getPath()"><!-- --></A><H3>getPath</H3><PRE>public <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[] <B>getPath</B>()</PRE><DL><DD>Returns the path from the root, to get to this node.  The last element in the path is this node.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an array of TreeNode objects giving the path, where the         first element in the path is the root and the last         element is this node.</DL></DD></DL><HR><A NAME="getPathToRoot(javax.swing.tree.TreeNode, int)"><!-- --></A><H3>getPathToRoot</H3><PRE>protected <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>[] <B>getPathToRoot</B>(<A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A>&nbsp;aNode,                                   int&nbsp;depth)</PRE><DL><DD>Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. The length of the returned array gives the node's depth in the tree.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>aNode</CODE> - the TreeNode to get the path for<DD><CODE>depth</CODE> - an int giving the number of steps already taken towards        the root (on recursive calls), used to size the returned array<DT><B>Returns:</B><DD>an array of TreeNodes giving the path from the root to the         specified node</DL></DD></DL><HR><A NAME="getUserObjectPath()"><!-- --></A><H3>getUserObjectPath</H3><PRE>public <A HREF="../../../java/lang/Object.html">Object</A>[] <B>getUserObjectPath</B>()</PRE><DL><DD>Returns the user object path, from the root, to get to this node. If some of the TreeNodes in the path have null user objects, the returned path will contain nulls.<DD><DL></DL></DD></DL><HR><A NAME="getRoot()"><!-- --></A><H3>getRoot</H3><PRE>public <A HREF="../../../javax/swing/tree/TreeNode.html">TreeNode</A> <B>getRoot</B>()</PRE><DL><DD>Returns the root of the tree that contains this node.  The root is the ancestor with a null parent.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the root of the tree that contains this node<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#isNodeAncestor(javax.swing.tree.TreeNode)"><CODE>isNodeAncestor(javax.swing.tree.TreeNode)</CODE></A></DL></DD></DL><HR><A NAME="isRoot()"><!-- --></A><H3>isRoot</H3><PRE>public boolean <B>isRoot</B>()</PRE><DL><DD>Returns true if this node is the root of the tree.  The root is the only node in the tree with a null parent; every tree has exactly one root.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if this node is the root of its tree</DL></DD></DL><HR><A NAME="getNextNode()"><!-- --></A><H3>getNextNode</H3><PRE>public <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A> <B>getNextNode</B>()</PRE><DL><DD>Returns the node that follows this node in a preorder traversal of this node's tree.  Returns null if this node is the last node of the traversal.  This is an inefficient way to traverse the entire tree; use an enumeration, instead.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the node that follows this node in a preorder traversal, or		null if this node is last<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#preorderEnumeration()"><CODE>preorderEnumeration()</CODE></A></DL></DD></DL><HR><A NAME="getPreviousNode()"><!-- --></A><H3>getPreviousNode</H3><PRE>public <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html">DefaultMutableTreeNode</A> <B>getPreviousNode</B>()</PRE><DL><DD>Returns the node that precedes this node in a preorder traversal of this node's tree.  Returns null if this node is the first node of the traveral -- the root of the tree.  This is an inefficient way to traverse the entire tree; use an enumeration, instead.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the node that precedes this node in a preorder traversal, or		null if this node is the first<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#preorderEnumeration()"><CODE>preorderEnumeration()</CODE></A></DL></DD></DL><HR><A NAME="preorderEnumeration()"><!-- --></A><H3>preorderEnumeration</H3><PRE>public <A HREF="../../../java/util/Enumeration.html">Enumeration</A> <B>preorderEnumeration</B>()</PRE><DL><DD>Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.  The first node returned by the enumeration's <code>nextElement()</code> method is this node.<P> Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration for traversing the tree in preorder<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#postorderEnumeration()"><CODE>postorderEnumeration()</CODE></A></DL></DD></DL><HR><A NAME="postorderEnumeration()"><!-- --></A><H3>postorderEnumeration</H3><PRE>public <A HREF="../../../java/util/Enumeration.html">Enumeration</A> <B>postorderEnumeration</B>()</PRE><DL><DD>Creates and returns an enumeration that traverses the subtree rooted at this node in postorder.  The first node returned by the enumeration's <code>nextElement()</code> method is the leftmost leaf.  This is the same as a depth-first traversal.<P> Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>an enumeration for traversing the tree in postorder<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#depthFirstEnumeration()"><CODE>depthFirstEnumeration()</CODE></A>, <A HREF="../../../javax/swing/tree/DefaultMutableTreeNode.html#preorderEnumeration()"><CODE>preorderEnumeration()</CODE></A></DL></DD></DL><HR><A NAME="breadthFirstEnumeration()"><!-- --></A><H3>breadthFirstEnumeration</H3><PRE>public <A HREF="../../../java/util/Enumeration.html">Enumeration</A> <B>breadthFirstEnumeration</B>()</PRE><DL><DD>Creates and returns an enumeration that traverses the subtree roote

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -