y25.base
Class LayeredGraph.LayerEdgeMapImpl

java.lang.Object
  extended byy25.base.LayeredGraph.LayerEdgeMapImpl
All Implemented Interfaces:
DataAcceptor, DataProvider, LayerEdgeMap
Enclosing class:
LayeredGraph

protected class LayeredGraph.LayerEdgeMapImpl
extends Object
implements LayerEdgeMap

An Implementation of the LayerEdgeMap interface based on a HashMap.


Field Summary
protected  HashMap map
          The HashMap that is used to store key/value pairs.
 
Constructor Summary
LayeredGraph.LayerEdgeMapImpl()
           
 
Method Summary
 Object get(Object layerEdge)
          Returns the value bound to the given layer edge.
 boolean getBool(Object layerEdge)
          Returns the boolean value bound to the given layer edge.
 double getDouble(Object layerEdge)
          Returns the double value bound to the given layer edge.
 int getInt(Object layerEdge)
          Returns the integer value bound to the given layer edge.
 Object remove(Object layerEdge)
          Removes the value stored for the given layer edge, if present.
 void set(Object layerEdge, Object value)
          Associates the given value to the given layer edge.
 void setBool(Object layerEdge, boolean value)
          Associates the given boolean value to the given layer edge.
 void setDouble(Object layerEdge, double value)
          Associates the given double value to the given layer edge.
 void setInt(Object layerEdge, int value)
          Associates the given integer value to the given layer edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected HashMap map
The HashMap that is used to store key/value pairs.

Constructor Detail

LayeredGraph.LayerEdgeMapImpl

public LayeredGraph.LayerEdgeMapImpl()
Method Detail

remove

public Object remove(Object layerEdge)
Description copied from interface: LayerEdgeMap
Removes the value stored for the given layer edge, if present. Returns the value that was previously stored for the layer edge, or null if there was no mapping for that layer edge. A null return can also mean that the map previously associated null with the given layer edge.

Specified by:
remove in interface LayerEdgeMap

get

public Object get(Object layerEdge)
Description copied from interface: LayerEdgeMap
Returns the value bound to the given layer edge. The value must have been assiciated to the given layer edge by a call to set.

Returns null if the map contains no mapping for this key. A return value of null does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to null.

Specified by:
get in interface LayerEdgeMap

set

public void set(Object layerEdge,
                Object value)
Description copied from interface: LayerEdgeMap
Associates the given value to the given layer edge.

Specified by:
set in interface LayerEdgeMap

getBool

public boolean getBool(Object layerEdge)
Description copied from interface: LayerEdgeMap
Returns the boolean value bound to the given layer edge. The value must have been assiciated to the given layer edge by a call to setBool.

Returns false if the map contains no mapping for this key. A return value of false does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to false.

Specified by:
getBool in interface LayerEdgeMap

getDouble

public double getDouble(Object layerEdge)
Description copied from interface: LayerEdgeMap
Returns the double value bound to the given layer edge. The value must have been assiciated to the given layer edge by a call to setDouble.

Returns 0.0 if the map contains no mapping for this key. A return value of 0.0 does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to 0.0.

Specified by:
getDouble in interface LayerEdgeMap

getInt

public int getInt(Object layerEdge)
Description copied from interface: LayerEdgeMap
Returns the integer value bound to the given layer edge. The value must have been assiciated to the given layer edge by a call to setInt.

Returns 0 if the map contains no mapping for this key. A return value of 0 does not necessarily indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to 0.

Specified by:
getInt in interface LayerEdgeMap

setBool

public void setBool(Object layerEdge,
                    boolean value)
Description copied from interface: LayerEdgeMap
Associates the given boolean value to the given layer edge.

Specified by:
setBool in interface LayerEdgeMap

setDouble

public void setDouble(Object layerEdge,
                      double value)
Description copied from interface: LayerEdgeMap
Associates the given double value to the given layer edge.

Specified by:
setDouble in interface LayerEdgeMap

setInt

public void setInt(Object layerEdge,
                   int value)
Description copied from interface: LayerEdgeMap
Associates the given integer value to the given layer edge.

Specified by:
setInt in interface LayerEdgeMap