Class TreeIterator

  • All Implemented Interfaces:
    Iterator

    public class TreeIterator
    extends Object
    implements Iterator
    Return a node stream from a doubly-linked tree whose nodes know what child index they are. No remove() is supported. Emit navigation nodes (DOWN, UP, and EOF) to let show tree structure.
    • Field Detail

      • firstTime

        protected boolean firstTime
      • nodes

        protected FastQueue nodes
        If we emit UP/DOWN nodes, we need to spit out multiple nodes per next() call.
    • Constructor Detail

      • TreeIterator

        public TreeIterator​(Object tree)
    • Method Detail

      • reset

        public void reset()
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator