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

Package class diagram package EdgeMapAsDoubleEdgeMap
java.lang.Object
  extended by net.sourceforge.combean.graph.containers.doubleval.EdgeMapAsDoubleEdgeMap
All Implemented Interfaces:
DoubleEdgeMap, FixedDoubleEdgeMap, InitializableWithDoubleDefaultValue, Initializable

public class EdgeMapAsDoubleEdgeMap
extends Object
implements DoubleEdgeMap

Use a 'normal' EdgeMap as DoubleEdgeMap


Constructor Summary
EdgeMapAsDoubleEdgeMap()
          Default constructor.
EdgeMapAsDoubleEdgeMap(EdgeMap<Double> edgeMap)
          Constructor.
 
Method Summary
 double getDouble(Edge e)
          Return the value for a given edge.
 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(Edge e, double newVal)
          Set a double value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeMapAsDoubleEdgeMap

public EdgeMapAsDoubleEdgeMap()
Default constructor. Wraps a MapAsEdgeMap.


EdgeMapAsDoubleEdgeMap

public EdgeMapAsDoubleEdgeMap(EdgeMap<Double> edgeMap)
Constructor. Wraps a given EdgeMap.

Parameters:
edgeMap - the EdgeMap to be wrapped.
Method Detail

putDouble

public double putDouble(Edge e,
                        double newVal)
Description copied from interface: DoubleEdgeMap
Set a double value.

Specified by:
putDouble in interface DoubleEdgeMap
Parameters:
e - the edge for which the value shall be set.
newVal - the value to set.
Returns:
the previous value of the edge.

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(Edge e)
Description copied from interface: FixedDoubleEdgeMap
Return the value for a given edge.

Specified by:
getDouble in interface FixedDoubleEdgeMap
Parameters:
e - the edge for which the value shall be returned.
Returns:
the value stored in the map for e.