dk.brics.xmlgraph
Class ReachableNodesProcessor

java.lang.Object
  extended by dk.brics.xmlgraph.NodeProcessor<Object>
      extended by dk.brics.xmlgraph.ReachableNodesProcessor

public class ReachableNodesProcessor
extends NodeProcessor<Object>

Node processor for processing each reachable node at most once.


Constructor Summary
ReachableNodesProcessor(XMLGraph xg)
          Constructs a new processor.
 
Method Summary
static List<Node> getReachableNodes(XMLGraph xg)
          Returns the set of reachable nodes in xg.
 Object pre(Node n)
          Keeps track of visited nodes.
 Object process(MultiContentNode n)
          Invokes the processor recursively on each child of the given node.
 Object process(SingleContentNode n)
          Invokes the processor recursively on the child of the given node.
 
Methods inherited from class dk.brics.xmlgraph.NodeProcessor
dispatch, dispatch, dispatch, dispatch, dispatch, dispatch, dispatch, post, process, process, process, process, process, process, process, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReachableNodesProcessor

public ReachableNodesProcessor(XMLGraph xg)
Constructs a new processor.

Parameters:
xg - XML graph
Method Detail

getReachableNodes

public static List<Node> getReachableNodes(XMLGraph xg)
Returns the set of reachable nodes in xg.

Parameters:
xg - XML graph
Returns:
reachable nodes in xg

pre

public Object pre(Node n)
Keeps track of visited nodes.

Overrides:
pre in class NodeProcessor<Object>
Parameters:
n - node
Returns:
null if and only if the given node has not been processed before

process

public Object process(MultiContentNode n)
Invokes the processor recursively on each child of the given node.

Overrides:
process in class NodeProcessor<Object>
Parameters:
n - node
Returns:
null

process

public Object process(SingleContentNode n)
Invokes the processor recursively on the child of the given node.

Overrides:
process in class NodeProcessor<Object>
Parameters:
n - node
Returns:
null


Copyright © 2005-2010 Anders Møller.