Class ChildIterator<T>

java.lang.Object
org.jhotdraw8.fxbase.tree.ChildIterator<T>
Type Parameters:
T - the element type
All Implemented Interfaces:
Iterator<T>

public class ChildIterator<T> extends Object implements Iterator<T>
Iterates over the children of a tree node.
Author:
Werner Randelshofer
  • Constructor Details

    • ChildIterator

      public ChildIterator(int childCount, IntFunction<T> getElementFunction)
      Creates a new instance.
      Parameters:
      childCount - the number of children
      getElementFunction - returns a child element given an index
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>