static class Collector.FirstFinder extends java.lang.Object implements NodeFilter
NodeFilter.FilterResult
Modifier and Type | Field and Description |
---|---|
private Evaluator |
eval |
private Element |
evalRoot |
private Element |
match |
Constructor and Description |
---|
FirstFinder(Evaluator eval) |
Modifier and Type | Method and Description |
---|---|
(package private) Element |
find(Element root,
Element start) |
NodeFilter.FilterResult |
head(Node node,
int depth)
Callback for when a node is first visited.
|
NodeFilter.FilterResult |
tail(Node node,
int depth)
Callback for when a node is last visited, after all of its descendants have been visited.
|
@Nullable private Element evalRoot
@Nullable private Element match
private final Evaluator eval
FirstFinder(Evaluator eval)
public NodeFilter.FilterResult head(Node node, int depth)
NodeFilter
head
in interface NodeFilter
node
- the node being visited.depth
- the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node of that will have depth 1.public NodeFilter.FilterResult tail(Node node, int depth)
NodeFilter
This method has a default implementation to return NodeFilter.FilterResult.CONTINUE
.
tail
in interface NodeFilter
node
- the node being visited.depth
- the depth of the node, relative to the root node. E.g., the root node has depth 0, and a child node of that will have depth 1.