Package org.apache.pivot.wtk.skin.terra
Class TerraTreeViewSkin.VisibleNodeIterator
- java.lang.Object
-
- org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.VisibleNodeIterator
-
- All Implemented Interfaces:
java.util.Iterator<org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo>
- Enclosing class:
- TerraTreeViewSkin
protected final class TerraTreeViewSkin.VisibleNodeIterator extends java.lang.Object implements java.util.Iterator<org.apache.pivot.wtk.skin.terra.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 callinggetPath()
on each node.
-
-
Constructor Summary
Constructors Constructor Description VisibleNodeIterator()
VisibleNodeIterator(int startIndex, int endIndex)
Creates a new visible node iterator that will iterate over a portion of the visible nodes list (useful during painting).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sequence.Tree.Path
getPath()
Gets the path of the node last returned by a call tonext()
.int
getRowIndex()
Gets the index of the node last returned by a call tonext()
, as seen in the current visible nodes list.boolean
hasNext()
org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo
next()
void
remove()
This operation is not supported by this iterator.
-
-
-
Constructor Detail
-
VisibleNodeIterator
public VisibleNodeIterator()
-
VisibleNodeIterator
public VisibleNodeIterator(int startIndex, int endIndex)
Creates a new visible node iterator that will iterate over a portion of the visible nodes list (useful during painting).- Parameters:
startIndex
- The start index, inclusiveendIndex
- The end index, inclusive
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo>
-
next
public org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo next()
- Specified by:
next
in interfacejava.util.Iterator<org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo>
-
remove
@UnsupportedOperation public void remove()
This operation is not supported by this iterator.- Specified by:
remove
in interfacejava.util.Iterator<org.apache.pivot.wtk.skin.terra.TerraTreeViewSkin.NodeInfo>
- Throws:
java.lang.UnsupportedOperationException
- always since this is unsupported.
-
getRowIndex
public int getRowIndex()
Gets the index of the node last returned by a call tonext()
, 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
ifnext()
has not yet been called.
-
getPath
public Sequence.Tree.Path getPath()
Gets the path of the node last returned by a call tonext()
.- Returns:
- The path to the node, or
null
ifnext()
has not yet been called.
-
-