net.sourceforge.combean.graph.containers.doubleval
Class NodeMapAsDoubleNodeMap

Package class diagram package NodeMapAsDoubleNodeMap
java.lang.Object
  extended by net.sourceforge.combean.graph.containers.doubleval.NodeMapAsDoubleNodeMap
All Implemented Interfaces:
Clearable, DoubleNodeMap, FixedDoubleNodeMap, InitializableWithDoubleDefaultValue, Initializable

public class NodeMapAsDoubleNodeMap
extends Object
implements DoubleNodeMap

Use a 'normal' NodeMap as DoubleNodeMap


Constructor Summary
NodeMapAsDoubleNodeMap()
          Default constructor.
NodeMapAsDoubleNodeMap(NodeMap<Double> nodeMap)
          Constructor.
 
Method Summary
 void clear()
          remove all elements from the data structure.
 double getDouble(Node v)
          Get the value of a node
 void init(Graph g)
          Has to be invoked before the data structure can be used.
 void init(Graph g, double initVal)
          Has to be invoked before the data structure can be used.
 double putDouble(Node v, double newVal)
          Set the value of a node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeMapAsDoubleNodeMap

public NodeMapAsDoubleNodeMap()
Default constructor. Wraps a MapAsNodeMap.


NodeMapAsDoubleNodeMap

public NodeMapAsDoubleNodeMap(NodeMap<Double> nodeMap)
Constructor. Wraps a given NodeMap.

Parameters:
nodeMap - the NodeMap to be wrapped.
Method Detail

putDouble

public double putDouble(Node v,
                        double newVal)
Description copied from interface: DoubleNodeMap
Set the value of a node

Specified by:
putDouble in interface DoubleNodeMap
Parameters:
v - the node for which the value shall be set
newVal - the new value of the node
Returns:
the old value of the node (null if no value has been set)

init

public void init(Graph g)
Description copied from interface: Initializable
Has to be invoked before the data structure can be used. The data structure may only be used with objects belonging to the given graph. After init() all potential objects in the data structure are set to null.

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

init

public void init(Graph g,
                 double initVal)
Description copied from interface: InitializableWithDoubleDefaultValue
Has to be invoked before the data structure can be used. The data structure may only be used with objects belonging to the given graph. After init() all potential elements of the data structure are set to the given default value.

Specified by:
init in interface InitializableWithDoubleDefaultValue
Parameters:
g - the graph for which the data structure shall be defined.
initVal - the default value with which the data structure shall be initialized

getDouble

public double getDouble(Node v)
Description copied from interface: FixedDoubleNodeMap
Get the value of a node

Specified by:
getDouble in interface FixedDoubleNodeMap
Parameters:
v - the node for which the value shall be retrieved
Returns:
the value of the node (null if no value has been set)

clear

public void clear()
Description copied from interface: Clearable
remove all elements from the data structure.

Specified by:
clear in interface Clearable