org.apache.pivot.wtk.skin.terra
Class TerraTreeViewSkin.VisibleNodeIterator

java.lang.Object
  extended by org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.VisibleNodeIterator
All Implemented Interfaces:
Iterator<TerraTreeViewSkin.NodeInfo>
Enclosing class:
TerraTreeViewSkin

protected final class TerraTreeViewSkin.VisibleNodeIterator
extends Object
implements Iterator<TerraTreeViewSkin.NodeInfo>

Iterates through the visible nodes. For callers who wish to know the path of each visible node, using this iterator will be much more efficient than manually iterating over the visible nodes and calling getPath() on each node.


Constructor Summary
TerraTreeViewSkin.VisibleNodeIterator()
           
TerraTreeViewSkin.VisibleNodeIterator(int start, int end)
          Creates a new visible node iterator that will iterate over a portion of the visible nodes list (useful during painting).
 
Method Summary
 Sequence.Tree.Path getPath()
          Gets the path of the node last returned by a call to next().
 int getRowIndex()
          Gets the index of the node last returned by a call to next(), as seen in the current visible nodes list.
 boolean hasNext()
          
 TerraTreeViewSkin.NodeInfo next()
          
 void remove()
          This operation is not supported by this iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerraTreeViewSkin.VisibleNodeIterator

public TerraTreeViewSkin.VisibleNodeIterator()

TerraTreeViewSkin.VisibleNodeIterator

public TerraTreeViewSkin.VisibleNodeIterator(int start,
                                             int end)
Creates a new visible node iterator that will iterate over a portion of the visible nodes list (useful during painting).

Parameters:
start - The start index, inclusive
end - The end index, inclusive
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator<TerraTreeViewSkin.NodeInfo>

next

public TerraTreeViewSkin.NodeInfo next()

Specified by:
next in interface Iterator<TerraTreeViewSkin.NodeInfo>

remove

public void remove()
This operation is not supported by this iterator.

Specified by:
remove in interface Iterator<TerraTreeViewSkin.NodeInfo>
Throws:
UnsupportedOperationException

getRowIndex

public int getRowIndex()
Gets the index of the node last returned by a call to next(), as seen in the current visible nodes list. Note that as branches are expanded and collapsed, the row index of any given node in the tree will change.

Returns:
The row index of the current node, or -1 if next() has not yet been called.

getPath

public Sequence.Tree.Path getPath()
Gets the path of the node last returned by a call to next().

Returns:
The path to the node, or null if next() has not yet been called.