Class 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 calling getPath() 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 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()
      org.apache.pivot.wtk.skin.terra.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
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • 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, inclusive
        endIndex - The end index, inclusive
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.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 interface java.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 interface java.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 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.