Class Node.PostOrderIterator.Level

java.lang.Object
com.github.javaparser.ast.Node.PostOrderIterator.Level
Enclosing class:
Node.PostOrderIterator

private static class Node.PostOrderIterator.Level extends 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 Details

    • nodes

      private final List<Node> nodes
    • index

      private int index
    • expanded

      private boolean expanded
  • Constructor Details

    • Level

      public Level(List<Node> nodes)
  • Method Details

    • 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