public class NodeIterator extends Object implements com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node>
| Modifier and Type | Field and Description |
|---|---|
static com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> |
EMPTY |
| Constructor and Description |
|---|
NodeIterator(Node firstNode) |
NodeIterator(Node firstNode,
boolean reversed) |
NodeIterator(Node firstNode,
Node lastNode) |
NodeIterator(Node firstNode,
Node lastNode,
boolean reversed)
iterate nodes until null or last node is iterated over
|
| Modifier and Type | Method and Description |
|---|---|
void |
forEachRemaining(Consumer<? super Node> consumer) |
boolean |
hasNext() |
boolean |
isReversed() |
Node |
next() |
@Nullable Node |
peek() |
void |
remove()
Remove the last node returned by
next() |
public static final com.vladsch.flexmark.util.collection.iteration.ReversiblePeekingIterator<Node> EMPTY
public NodeIterator(Node firstNode)
firstNode - node from which to start the iteration and continue until all sibling nodes have been traversedpublic NodeIterator(Node firstNode, boolean reversed)
firstNode - node from which to start the iteration and continue until all sibling nodes have been traversedreversed - true/false if the nodes are to be traversed in reverse order. If true the nodes previous sibling will be used instead of next siblingpublic NodeIterator(Node firstNode, Node lastNode)
firstNode - node from which to start the iteration and continue until all sibling nodes have been traversed or lastNode has been traversedlastNode - the last node to be traversedpublic NodeIterator(Node firstNode, Node lastNode, boolean reversed)
firstNode - node from which to start the iteration and continue until all sibling nodes have been traversed or lastNode has been traversedlastNode - the last node to be traversedreversed - true/false if the nodes are to be traversed in reverse order. If true the nodes previous sibling will be used instead of next siblingpublic boolean isReversed()
isReversed in interface com.vladsch.flexmark.util.collection.iteration.ReversibleIterator<Node>public boolean hasNext()
public Node next()
@Nullable public @Nullable Node peek()
public void remove()
next()public void forEachRemaining(Consumer<? super Node> consumer)
forEachRemaining in interface Iterator<Node>Copyright © 2020. All rights reserved.