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

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

public class ConstructPredMapVisitor
extends IdleTraversalVisitor
implements TraversalVisitor


Constructor Summary
ConstructPredMapVisitor()
          constructor
 
Method Summary
 NodeMap<Edge> getPredMap()
           
 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 openNeighbor(Edge e, Node from)
          A node has been detected for the first time.
 boolean readyToTerminate()
          Signal if the traversal can be terminated.
 void setPredMap(NodeMap<Edge> predMap)
           
 void setTarget(Node target)
          Set target node where the construction of the predecessor map shall terminate.
 
Methods inherited from class net.sourceforge.combean.graph.alg.traversal.IdleTraversalVisitor
finish, leaveComponent, reopenNeighbor, visitComponent, visitNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.combean.interfaces.graph.alg.traverse.TraversalVisitor
finish, leaveComponent, reopenNeighbor, visitComponent, visitNode
 

Constructor Detail

ConstructPredMapVisitor

public ConstructPredMapVisitor()
constructor

Method Detail

getPredMap

public final NodeMap<Edge> getPredMap()
Returns:
Returns the predMap.

setPredMap

public final void setPredMap(NodeMap<Edge> predMap)
Parameters:
predMap - The predMap to set.

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)

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(Graph, net.sourceforge.combean.interfaces.graph.Node)

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
Overrides:
openNeighbor in class IdleTraversalVisitor
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)

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
Overrides:
readyToTerminate in class IdleTraversalVisitor
Returns:
true if termination is possible.
See Also:
TraversalVisitor.readyToTerminate()

setTarget

public final void setTarget(Node target)
Set target node where the construction of the predecessor map shall terminate. If no target node is set, all reachable nodes will be visited.

Parameters:
target - The target to set.