|
aXSL API 0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A TreeNode that is aware of its relationships not only to its parents and children, but also to its siblings. The order and placement of children is significant.
Method Summary | |
java.util.List |
getChildren()
Return the List of this node's children. |
OrderedTreeNode |
getFirstChild()
Returns the first child of this node. |
OrderedTreeNode |
getFirstLeaf()
Finds and returns the first leaf that is a descendant of this node -- either this node or its first child's first leaf. |
OrderedTreeNode |
getLastChild()
Returns the last child of this node. |
OrderedTreeNode |
getLastLeaf()
Finds and returns the last leaf that is a descendant of this node -- either this node or its last child's last leaf. |
OrderedTreeNode |
getNextLeaf()
Returns the leaf after this node or null if this node is the last leaf in the tree. |
OrderedTreeNode |
getNextSibling()
Returns the next sibling node. |
OrderedTreeNode |
getPreviousLeaf()
Returns the leaf before this node or null if this node is the first leaf in the tree. |
OrderedTreeNode |
getPreviousSibling()
Returns the previous sibling node. |
java.util.List |
getSiblings()
Returns the List of this node's parent's children, which includes this node. |
boolean |
hasChildren()
Reports whether this node has any children. |
OrderedTreeNode |
nextPreOrderNode()
Returns the next node in the tree relative to the current node, in pre-order traversal order. |
int |
siblingIndex()
Returns this node's position within the siblings. |
Methods inherited from interface javax.swing.tree.TreeNode |
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf |
Method Detail |
public java.util.List getChildren()
public java.util.List getSiblings()
public int siblingIndex()
public OrderedTreeNode getPreviousSibling()
public OrderedTreeNode getNextSibling()
public boolean hasChildren()
public OrderedTreeNode getFirstChild()
public OrderedTreeNode getLastChild()
public OrderedTreeNode nextPreOrderNode()
public OrderedTreeNode getFirstLeaf()
DefaultMutableTreeNode
).
TreeNode.isLeaf()
,
DefaultMutableTreeNode.isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)
public OrderedTreeNode getLastLeaf()
DefaultMutableTreeNode
).
TreeNode.isLeaf()
,
DefaultMutableTreeNode.isNodeDescendant(javax.swing.tree.DefaultMutableTreeNode)
public OrderedTreeNode getNextLeaf()
In this implementation of the MutableNode
interface,
this operation is very inefficient. In order to determine the
next node, this method first performs a linear search in the
parent's child-list in order to find the current node.
That implementation makes the operation suitable for short
traversals from a known position. But to traverse all of the
leaves in the tree, you should use depthFirstEnumeration
to enumerate the nodes in the tree and use isLeaf
on each node to determine which are leaves.
(Liberated from DefaultMutableTreeNode
).
DefaultMutableTreeNode.depthFirstEnumeration()
,
TreeNode.isLeaf()
public OrderedTreeNode getPreviousLeaf()
In this implementation of the MutableNode
interface,
this operation is very inefficient. In order to determine the
previous node, this method first performs a linear search in the
parent's child-list in order to find the current node.
That implementation makes the operation suitable for short
traversals from a known position. But to traverse all of the
leaves in the tree, you should use depthFirstEnumeration
to enumerate the nodes in the tree and use isLeaf
on each node to determine which are leaves.
(Liberated from DefaultMutableTreeNode
).
DefaultMutableTreeNode.depthFirstEnumeration()
,
TreeNode.isLeaf()
|
aXSL API 0.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This documentation was created September 6 2006 by The aXSL Group and may be freely copied. See license for details.