public class NodeListFilter extends Object
A derived class will typically override the accept(Node) method,
and can further refine the behaviour by overriding init(),
checkChildren(Node) or checkFinished().
| Constructor and Description |
|---|
NodeListFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(Node node)
Determines whether node is to be included in the filtered list of nodes.
|
boolean |
checkChildren(Node node)
Determines whether the filter should search the children of this node.
|
boolean |
checkFinished()
Determines whether a search should continue or not.
|
List<Node> |
filterNodes(Node startNode)
Searches the startNode all descendants of startNode.
|
List<Node> |
filterNodes(Node startNode,
int level)
Searches the startNode all descendants of startNode down to the level specified.
|
List<Node> |
filterNodes(Node startNode,
int level,
List<Node> nodeList)
Searches the startNode all descendants of startNode down to the level specified.
|
void |
init()
This method is called when a search is started.
|
public boolean accept(Node node)
node - the node to test for inclusiontrue if the node is to be included. The default implementation
always returns true.public boolean checkChildren(Node node)
node - the node to checktrue if the filter should search children of node.public boolean checkFinished()
true if we're done, false if we're to keep searching.public void init()
public List<Node> filterNodes(Node startNode)
startNode - the node to start searching from.public List<Node> filterNodes(Node startNode, int level, List<Node> nodeList)
nodeList.startNode - the node to start searching from.level - public List<Node> filterNodes(Node startNode, int level)
startNode - the node to start searching from.level - Copyright © 2010 - 2020 Adobe. All Rights Reserved