Package org.jdesktop.swingx.tree
Class TreeUtilities.PreorderModelEnumeration
- java.lang.Object
-
- org.jdesktop.swingx.tree.TreeUtilities.PreorderModelEnumeration
-
- All Implemented Interfaces:
java.util.Enumeration
- Enclosing class:
- TreeUtilities
public static class TreeUtilities.PreorderModelEnumeration extends java.lang.Object implements java.util.Enumeration
Implementation of a preorder traversal of a TreeModel.
-
-
Constructor Summary
Constructors Constructor Description PreorderModelEnumeration(javax.swing.tree.TreeModel model)
Instantiates a preorder traversal starting from the root of the TreeModel.PreorderModelEnumeration(javax.swing.tree.TreeModel model, java.lang.Object node)
Instantiates a preorder traversal of the TreeModel which starts at the given node.PreorderModelEnumeration(javax.swing.tree.TreeModel model, javax.swing.tree.TreePath path)
Instantiates a preorder traversal of the TreeModel which starts at the last path component of the given TreePath.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMoreElements()
java.lang.Object
nextElement()
private void
pushNodeAsEnumeration(java.lang.Object node)
private void
updateSubtree()
-
-
-
Constructor Detail
-
PreorderModelEnumeration
public PreorderModelEnumeration(javax.swing.tree.TreeModel model)
Instantiates a preorder traversal starting from the root of the TreeModel.- Parameters:
model
- the TreeModel to travers.
-
PreorderModelEnumeration
public PreorderModelEnumeration(javax.swing.tree.TreeModel model, java.lang.Object node)
Instantiates a preorder traversal of the TreeModel which starts at the given node. It iterates over all nodes of the subtree, only.- Parameters:
model
- the TreeModel to travers.node
- the node to start
-
PreorderModelEnumeration
public PreorderModelEnumeration(javax.swing.tree.TreeModel model, javax.swing.tree.TreePath path)
Instantiates a preorder traversal of the TreeModel which starts at the last path component of the given TreePath. It iterates over all nodes of the subtree and all of its siblings, with the same end as a traversal starting at the model's roolt would have.- Parameters:
model
- the TreeModel to travers.path
- the TreePath to start from
-
-
Method Detail
-
hasMoreElements
public boolean hasMoreElements()
- Specified by:
hasMoreElements
in interfacejava.util.Enumeration
-
nextElement
public java.lang.Object nextElement()
- Specified by:
nextElement
in interfacejava.util.Enumeration
-
updateSubtree
private void updateSubtree()
-
pushNodeAsEnumeration
private void pushNodeAsEnumeration(java.lang.Object node)
-
-