Package com.github.javaparser.ast
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 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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
done()
Returnstrue
if the last node was reached.Node
getCurrent()
Returns the current node.void
goToNext()
Sets the next node as the current node.boolean
isCurrentExpanded()
Returnstrue
if the current node was expanded.void
setCurrentExpanded()
Marks the current node as expanded.
-
-
-
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()
Returnstrue
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()
Returnstrue
if the current node was expanded.- Returns:
true
if the current node was expanded
-
-