net.sourceforge.combean.graph.alg.partition
Class PartitionsTraversalVisitor

Package class diagram package PartitionsTraversalVisitor
java.lang.Object
  extended by net.sourceforge.combean.graph.alg.traversal.IdleTraversalVisitor
      extended by net.sourceforge.combean.graph.alg.partition.PartitionsTraversalVisitor
All Implemented Interfaces:
TraversalVisitor

public class PartitionsTraversalVisitor
extends IdleTraversalVisitor

This class wraps a NodePartitionsVisitor inside a traversal visitor. Every components that is encountered during the traversal is reported from the traversal visitor to the node partition visitor.

See Also:
PartitionsTraversalVisitor, TraversalVisitor

Constructor Summary
PartitionsTraversalVisitor(NodePartitionVisitor partitionVis)
           
 
Method Summary
 void finish()
          This method is called when the traversal is terminated.
 void init(Graph g)
          This method is called immediately before the traversal algorithm starts if all components of g shall be traversed.
 void leaveComponent(Node v)
          The traversal algorithm has finished visiting a component of the graph.
 void visitComponent(Node v)
          The traversal algorithms starts visiting a component of the graph.
 void visitNode(Node v)
          The traversal algorithms begins to explore the neighborhood of a node.
 
Methods inherited from class net.sourceforge.combean.graph.alg.traversal.IdleTraversalVisitor
initLocal, openNeighbor, readyToTerminate, reopenNeighbor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionsTraversalVisitor

public PartitionsTraversalVisitor(NodePartitionVisitor partitionVis)
Method Detail

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(Graph)

leaveComponent

public void leaveComponent(Node v)
Description copied from interface: TraversalVisitor
The traversal algorithm has finished visiting a component of the graph. This is also called (exactly once) when the traversal starts from a local start node.

Specified by:
leaveComponent in interface TraversalVisitor
Overrides:
leaveComponent in class IdleTraversalVisitor
Parameters:
v - an arbitrary node in the component.
See Also:
TraversalVisitor.leaveComponent(net.sourceforge.combean.interfaces.graph.Node)

visitComponent

public void visitComponent(Node v)
Description copied from interface: TraversalVisitor
The traversal algorithms starts visiting a component of the graph. This is also called (exactly once) when the traversal starts from a local start node.

Specified by:
visitComponent in interface TraversalVisitor
Overrides:
visitComponent in class IdleTraversalVisitor
Parameters:
v - an arbitrary node in the component.
See Also:
TraversalVisitor.visitComponent(net.sourceforge.combean.interfaces.graph.Node)

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)

finish

public void finish()
Description copied from interface: TraversalVisitor
This method is called when the traversal is terminated.

Specified by:
finish in interface TraversalVisitor
Overrides:
finish in class IdleTraversalVisitor