Package com.tailf.navu.traversal

Utility package for traversing the NAVU tree using NAVU API.

See: Description

Package com.tailf.navu.traversal Description

Utility package for traversing the NAVU tree using NAVU API. The configuration tree means all existing keypaths that exists will be processed.

There is the ability to retrieve all the NavuNodes that exists both in CDB and trough external data.

There are two ways that one could use the Traversal API:

The following example shows a passive traversal (Breadth-first traversal)

 NavuContext ctx = new NavuContext(maapi,th);
  NavuTreeTraversal traversalProcess = NavuTreeTraversal
          .createInstance(ctx,new NavuTraversalBfsMean());
      traversalProcess.addFilter(new TraversalFilte(){
              public void currentNode(NavuNode node) throws NavuException{
                  //process the current node
              }
          }
       traversalProcess.traverse();
  
The following example shows a passive traversal (Depth-first traversal)
 NavuContext ctx = new NavuContext(maapi,th);
  NavuTreeTraversal traversalProcess = NavuTreeTraversal
          .createInstance(ctx,new NavuTraversalDfsMean());
      traversalProcess.addFilter(new TraversalFilter(){
              public void currentNode(NavuNode node) throws NavuException{
                  //process the current node
              }
          }
        traversalProcess.traverse();
  
The following example shows a active traversal
    NavuContext ctx = new NavuContext(maapi,th);
    Iterator<NavuNode> it = NavuTreeTraversal.iterator(ctx);
     while(it.hasNext()){
         NavuNode currentNode = it.next();
          //Process the node
     }