public class NavuTreeTraversal extends Object
Starting point for both Active and Passive mode traversal
Starting class from which one could retrieve an iterator
or create an instance for register "filters" which is
used to supplied implementation for which the iteration process
will call when it encounters a visited NavuNode
.
Modifier and Type | Method and Description |
---|---|
void |
addFilter(TraversalFilter filter) |
static NavuTreeTraversal |
createInstance(NavuContext ctx,
NavuTraversalMean travmeth)
Factory method to retrieve an instance of this class.
|
static Iterator<NavuNode> |
iterator(NavuContext ctx)
Retrieve an iterator to traverse the entire NAVU tree.
|
static Iterator<NavuNode> |
iterator(NavuNode startNode)
Retrieve an iterator to traverse part of a NAVU tree.
|
void |
printChain(NavuNode node) |
Set<String> |
traverse()
Start the traversal process.
|
public void addFilter(TraversalFilter filter)
public static NavuTreeTraversal createInstance(NavuContext ctx, NavuTraversalMean travmeth) throws NavuException
NavuException
public static Iterator<NavuNode> iterator(NavuContext ctx)
Retrieve an iterator to traverse the entire NAVU tree.
This method should be used if we want to traverse the whole NAVU tree (each existing paths) which is all the loaded yang modules exists.
This is the active mode for which to
traverse the tree, which means that to retrieve next
NavuNode
in the traversal one needs to "pull" out the next
NavuNode
.
ctx
- Context to which the iteration process will use.public static Iterator<NavuNode> iterator(NavuNode startNode)
Retrieve an iterator to traverse part of a NAVU tree.
This method should be used if we want to traverse a part of the tree starting from the children of suppliedNavuNode
. This is the active mode for
which to traverse the tree.startNode
- The starting NavuNode for which to consider the
root node for the iteration process .NavuNode
public void printChain(NavuNode node)
public Set<String> traverse() throws NavuException
For each encountered NavuNode by the process it will invoke all added filters
NavuException