net.sourceforge.combean.graph.alg.traversal
Class NodeCountVisitor
java.lang.Object
net.sourceforge.combean.graph.alg.traversal.IdleTraversalVisitor
net.sourceforge.combean.graph.alg.traversal.NodeCountVisitor
- All Implemented Interfaces:
- TraversalVisitor
public class NodeCountVisitor
- extends IdleTraversalVisitor
Method Summary |
long |
getNodeCount()
Get the number of visited nodes. |
void |
init(Graph g)
This method is called immediately before the traversal algorithm starts
if all components of g shall be traversed. |
void |
initLocal(Graph g,
Node startNode)
This method is called immediately before the traversal algorithm starts
if a component of g shall be traversed from a local start node. |
void |
visitNode(Node v)
The traversal algorithms begins to explore the neighborhood of a node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NodeCountVisitor
public NodeCountVisitor()
getNodeCount
public final long getNodeCount()
- Get the number of visited nodes.
- Returns:
- Returns the nodeCount.
visitNode
public void visitNode(Node v)
- Description copied from interface:
TraversalVisitor
- The traversal algorithms begins to explore the neighborhood of a node.
- Specified by:
visitNode
in interface TraversalVisitor
- Overrides:
visitNode
in class IdleTraversalVisitor
- Parameters:
v
- the node which is being visited.- See Also:
TraversalVisitor.visitNode(net.sourceforge.combean.interfaces.graph.Node)
init
public void init(Graph g)
- Description copied from interface:
TraversalVisitor
- This method is called immediately before the traversal algorithm starts
if all components of g shall be traversed.
- Specified by:
init
in interface TraversalVisitor
- Overrides:
init
in class IdleTraversalVisitor
- Parameters:
g
- the graph which will be traversed.- See Also:
TraversalVisitor.init(net.sourceforge.combean.interfaces.graph.Graph)
initLocal
public void initLocal(Graph g,
Node startNode)
- Description copied from interface:
TraversalVisitor
- This method is called immediately before the traversal algorithm starts
if a component of g shall be traversed from a local start node.
- Specified by:
initLocal
in interface TraversalVisitor
- Overrides:
initLocal
in class IdleTraversalVisitor
- Parameters:
g
- the graph which will be traversed.startNode
- the local start node.- See Also:
TraversalVisitor.initLocal(net.sourceforge.combean.interfaces.graph.Graph, net.sourceforge.combean.interfaces.graph.Node)