Package com.vladsch.flexmark.util.ast
Class DescendantNodeIterator
- java.lang.Object
-
- com.vladsch.flexmark.util.ast.DescendantNodeIterator
-
- All Implemented Interfaces:
ReversibleIterator<Node>
,ReversiblePeekingIterator<Node>
,java.util.Iterator<Node>
public class DescendantNodeIterator extends java.lang.Object implements ReversiblePeekingIterator<Node>
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isReversed
private @NotNull ReversiblePeekingIterator<Node>
iterator
private @Nullable java.util.Stack<ReversiblePeekingIterator<Node>>
iteratorStack
private Node
result
-
Constructor Summary
Constructors Constructor Description DescendantNodeIterator(@NotNull ReversiblePeekingIterator<Node> iterator)
iterate nodes, with descendants, depth first until all are done
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forEachRemaining(@NotNull java.util.function.Consumer<? super Node> consumer)
boolean
hasNext()
boolean
isReversed()
@NotNull Node
next()
@Nullable Node
peek()
void
remove()
-
-
-
Field Detail
-
isReversed
private final boolean isReversed
-
iterator
@NotNull private @NotNull ReversiblePeekingIterator<Node> iterator
-
iteratorStack
@Nullable private @Nullable java.util.Stack<ReversiblePeekingIterator<Node>> iteratorStack
-
result
private Node result
-
-
Constructor Detail
-
DescendantNodeIterator
public DescendantNodeIterator(@NotNull @NotNull ReversiblePeekingIterator<Node> iterator)
iterate nodes, with descendants, depth first until all are done- Parameters:
iterator
- iterator to use for iterating nodes and their descendants
-
-
Method Detail
-
isReversed
public boolean isReversed()
- Specified by:
isReversed
in interfaceReversibleIterator<Node>
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<Node>
-
peek
@Nullable public @Nullable Node peek()
- Specified by:
peek
in interfaceReversiblePeekingIterator<Node>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<Node>
-
-