net.sourceforge.combean.interfaces.graph.alg.partition
Interface NodePartitionVisitor

Package class diagram package NodePartitionVisitor
All Known Implementing Classes:
NodeNumberingAsPartitionVisitor

public interface NodePartitionVisitor

A Visitor which is used by partitioning algorithms to return the partitions which were found.

See Also:
PartitioningAlg

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.
 

Method Detail

init

void init(Graph g)
Has to be invoked before the actual processing of the PartitioningAlg starts.

Parameters:
g - the graph which shall be processed.

startPartition

void startPartition()
Has to be invoked before all calls to addNode of a partition.


addNode

void addNode(Node v)
Has to be invoked exactly once for all nodes of the graph, properly enclosed by calls to start/endPartition().

Parameters:
v - a node which belongs to the current partition, started with a call to startPartition().

endPartition

void endPartition()
Has to be invoked after all calls to addNode of a partition.


finish

void finish()
Has to be invoked after processing of the ParititioningAlg is complete.


getNumPartitions

int getNumPartitions()
Get the number of partitions found. May only be called after finish().

Returns:
the number of partitions found.