net.sourceforge.combean.graph.containers
Class MapAsNodeNumbering

Package class diagram package MapAsNodeNumbering
java.lang.Object
  extended by net.sourceforge.combean.graph.containers.MapAsNodeNumbering
All Implemented Interfaces:
NodeNumbering

public class MapAsNodeNumbering
extends Object
implements NodeNumbering


Constructor Summary
MapAsNodeNumbering()
          Constructor.
 
Method Summary
 void fill(int num)
          Set the node number of all nodes to a given value.
 int getNumber(Node v)
          Get the number of a single node.
 void init(Graph g)
          Has to be invoked before the data structure can be used.
 void setNumber(Node v, int num)
          Set the number of a single node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapAsNodeNumbering

public MapAsNodeNumbering()
Constructor. Use a HashMap internally

Method Detail

init

public void init(Graph g)
Description copied from interface: NodeNumbering
Has to be invoked before the data structure can be used. The data structure may only be used with nodes belonging to the given graph. After init() the content of the NodeNumbering is still undefined. Use fill if you want to define it.

Specified by:
init in interface NodeNumbering
Parameters:
g - the graph for which the NodeNumbering shall be defined.

fill

public void fill(int num)
Description copied from interface: NodeNumbering
Set the node number of all nodes to a given value.

Specified by:
fill in interface NodeNumbering
Parameters:
num - the value which shall be set.

setNumber

public void setNumber(Node v,
                      int num)
Description copied from interface: NodeNumbering
Set the number of a single node.

Specified by:
setNumber in interface NodeNumbering
Parameters:
v - the node
num - the number to be set

getNumber

public int getNumber(Node v)
Description copied from interface: NodeNumbering
Get the number of a single node.

Specified by:
getNumber in interface NodeNumbering
Returns:
the number of v