net.sourceforge.combean.graph.alg.traversal
Class IdleTraversalVisitor

Package class diagram package IdleTraversalVisitor
java.lang.Object
  extended by net.sourceforge.combean.graph.alg.traversal.IdleTraversalVisitor
All Implemented Interfaces:
TraversalVisitor
Direct Known Subclasses:
ConstructPredMapVisitor, IdleDFSVisitor, NodeCountVisitor, PartitionsTraversalVisitor

public class IdleTraversalVisitor
extends Object
implements TraversalVisitor


Constructor Summary
IdleTraversalVisitor()
           
 
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 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 leaveComponent(Node v)
          The traversal algorithm has finished visiting a component of the graph.
 void openNeighbor(Edge e, Node from)
          A node has been detected for the first time.
 boolean readyToTerminate()
          Signal if the traversal can be terminated.
 void reopenNeighbor(Edge e, Node from)
          A node has been redetected
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdleTraversalVisitor

public IdleTraversalVisitor()
Method Detail

readyToTerminate

public boolean readyToTerminate()
Description copied from interface: TraversalVisitor
Signal if the traversal can be terminated. Note that this is only a suggestion to the traversal algorithm.

Specified by:
readyToTerminate in interface TraversalVisitor
Returns:
true if termination is possible.
See Also:
TraversalVisitor.readyToTerminate()

openNeighbor

public void openNeighbor(Edge e,
                         Node from)
Description copied from interface: TraversalVisitor
A node has been detected for the first time.

Specified by:
openNeighbor in interface TraversalVisitor
Parameters:
e - the edge through which the node has been detected.
from - the other node from where the new node has been detected.
See Also:
TraversalVisitor.openNeighbor(net.sourceforge.combean.interfaces.graph.Edge, net.sourceforge.combean.interfaces.graph.Node)

reopenNeighbor

public void reopenNeighbor(Edge e,
                           Node from)
Description copied from interface: TraversalVisitor
A node has been redetected

Specified by:
reopenNeighbor in interface TraversalVisitor
Parameters:
e - the edge through which the node has been detected.
from - the other node from where the node has been detected.
See Also:
TraversalVisitor.reopenNeighbor(net.sourceforge.combean.interfaces.graph.Edge, 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
Parameters:
v - the node which is being visited.
See Also:
TraversalVisitor.visitNode(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
Parameters:
v - an arbitrary node in the component.
See Also:
TraversalVisitor.visitComponent(net.sourceforge.combean.interfaces.graph.Node)

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
Parameters:
v - an arbitrary node in the component.
See Also:
TraversalVisitor.leaveComponent(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
Parameters:
g - the graph which will be traversed.
See Also:
TraversalVisitor.init(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
Parameters:
g - the graph which will be traversed.
startNode - the local start node.
See Also:
TraversalVisitor.initLocal(Graph, 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