Class Node.PostOrderIterator.Level

  • Enclosing class:
    Node.PostOrderIterator

    private static class Node.PostOrderIterator.Level
    extends java.lang.Object
    Represents a level in the traversal stack during the post-order iteration. A level consists of a list of siblings to be traversed, an index indicating the current node, and a flag to indicate if the current node has been expanded, i.e., if its children have been processed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean expanded  
      private int index  
      private java.util.List<Node> nodes  
    • Constructor Summary

      Constructors 
      Constructor Description
      Level​(java.util.List<Node> nodes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean done()
      Returns true if the last node was reached.
      Node getCurrent()
      Returns the current node.
      void goToNext()
      Sets the next node as the current node.
      boolean isCurrentExpanded()
      Returns true if the current node was expanded.
      void setCurrentExpanded()
      Marks the current node as expanded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • nodes

        private final java.util.List<Node> nodes
      • index

        private int index
      • expanded

        private boolean expanded
    • Constructor Detail

      • Level

        public Level​(java.util.List<Node> nodes)
    • Method Detail

      • done

        public boolean done()
        Returns true if the last node was reached.
        Returns:
        true if the last node was reached
      • getCurrent

        public Node getCurrent()
        Returns the current node.
        Returns:
        the current node
      • goToNext

        public void goToNext()
        Sets the next node as the current node.
      • setCurrentExpanded

        public void setCurrentExpanded()
        Marks the current node as expanded.
      • isCurrentExpanded

        public boolean isCurrentExpanded()
        Returns true if the current node was expanded.
        Returns:
        true if the current node was expanded