javax.swing.tree
Class VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration

java.lang.Object
  extended byjavax.swing.tree.VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration
All Implemented Interfaces:
Enumeration
Enclosing class:
VariableHeightLayoutCache

private class VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration
extends Object
implements Enumeration

An enumerator to iterate through visible nodes.


Field Summary
protected  int childCount
          Number of children in parent.
protected  int nextIndex
          Index of next child.
protected  VariableHeightLayoutCache.TreeStateNode parent
          Parent thats children are being enumerated.
 
Constructor Summary
protected VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache.TreeStateNode node)
           
protected VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache.TreeStateNode parent, int startIndex)
           
 
Method Summary
protected  boolean findNextValidParent()
          Finds the next valid parent, this should be called when nextIndex is beyond the number of children of the current parent.
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
protected  boolean updateNextIndex()
          Updates nextIndex returning false if it is beyond the number of children of parent.
protected  void updateNextObject()
          Determines the next object by invoking updateNextIndex and if not succesful findNextValidParent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected VariableHeightLayoutCache.TreeStateNode parent
Parent thats children are being enumerated.


nextIndex

protected int nextIndex
Index of next child. An index of -1 signifies parent should be visibled next.


childCount

protected int childCount
Number of children in parent.

Constructor Detail

VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration

protected VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache.TreeStateNode node)

VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration

protected VariableHeightLayoutCache.VisibleTreeStateNodeEnumeration(VariableHeightLayoutCache.TreeStateNode parent,
                                                                    int startIndex)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Description copied from interface: Enumeration
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface Enumeration
Returns:
true if more visible nodes.

nextElement

public Object nextElement()
Description copied from interface: Enumeration
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface Enumeration
Returns:
next visible TreePath.

updateNextObject

protected void updateNextObject()
Determines the next object by invoking updateNextIndex and if not succesful findNextValidParent.


findNextValidParent

protected boolean findNextValidParent()
Finds the next valid parent, this should be called when nextIndex is beyond the number of children of the current parent.


updateNextIndex

protected boolean updateNextIndex()
Updates nextIndex returning false if it is beyond the number of children of parent.