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

Package class diagram package NodeNumberingAsPartitionVisitor
java.lang.Object
  extended by net.sourceforge.combean.graph.alg.partition.NodeNumberingAsPartitionVisitor
All Implemented Interfaces:
NodePartitionVisitor

public class NodeNumberingAsPartitionVisitor
extends Object
implements NodePartitionVisitor

Use a node numbering to store the partition numbers. Counting of the partitions starts from 1;


Constructor Summary
NodeNumberingAsPartitionVisitor(NodeNumbering numbering)
          Constructor
 
Method Summary
 void addNode(Node v)
          Has to be invoked exactly once for all nodes of the graph, properly enclosed by calls to start/endPartition().
 void endPartition()
          Has to be invoked after all calls to addNode of a partition.
 void finish()
          Has to be invoked after processing of the ParititioningAlg is complete.
 int getNumPartitions()
          Get the number of partitions found.
 void init(Graph g)
          Has to be invoked before the actual processing of the PartitioningAlg starts.
 void startPartition()
          Has to be invoked before all calls to addNode of a partition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeNumberingAsPartitionVisitor

public NodeNumberingAsPartitionVisitor(NodeNumbering numbering)
Constructor

Parameters:
numbering - the numbering to be used for storing the partitions.
Method Detail

init

public void init(Graph g)
Description copied from interface: NodePartitionVisitor
Has to be invoked before the actual processing of the PartitioningAlg starts.

Specified by:
init in interface NodePartitionVisitor
Parameters:
g - the graph which shall be processed.

startPartition

public void startPartition()
Description copied from interface: NodePartitionVisitor
Has to be invoked before all calls to addNode of a partition.

Specified by:
startPartition in interface NodePartitionVisitor

addNode

public void addNode(Node v)
Description copied from interface: NodePartitionVisitor
Has to be invoked exactly once for all nodes of the graph, properly enclosed by calls to start/endPartition().

Specified by:
addNode in interface NodePartitionVisitor
Parameters:
v - a node which belongs to the current partition, started with a call to startPartition().

endPartition

public void endPartition()
Description copied from interface: NodePartitionVisitor
Has to be invoked after all calls to addNode of a partition.

Specified by:
endPartition in interface NodePartitionVisitor

finish

public void finish()
Description copied from interface: NodePartitionVisitor
Has to be invoked after processing of the ParititioningAlg is complete.

Specified by:
finish in interface NodePartitionVisitor

getNumPartitions

public int getNumPartitions()
Description copied from interface: NodePartitionVisitor
Get the number of partitions found. May only be called after finish().

Specified by:
getNumPartitions in interface NodePartitionVisitor
Returns:
the number of partitions found.