y25.base
Class LayeredGraph.EdgeMapImpl

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

protected class LayeredGraph.EdgeMapImpl
extends Object
implements EdgeMap

An Implementation of the EdgeMap interface based on a HashMap.


Field Summary
protected  HashMap map
          The HashMap that is used to store key/value pairs.
 
Method Summary
 Object get(Object key)
          Returns the value bound to the given edge.
 boolean getBool(Object edge)
          Returns the boolean value bound to the given edge.
 double getDouble(Object edge)
          Returns the double value bound to the given edge.
 int getInt(Object edge)
          Returns the integer value bound to the given edge.
 Object remove(Object edge)
          Removes the value stored for the given edge, if present.
 void set(Object key, Object value)
          Associates the given value to the given edge.
 void setBool(Object edge, boolean value)
          Associates the given boolean value to the given edge.
 void setDouble(Object edge, double value)
          Associates the given double value to the given edge.
 void setInt(Object edge, int value)
          Associates the given integer value to the given 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.

Method Detail

remove

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

Specified by:
remove in interface EdgeMap

set

public void set(Object key,
                Object value)
Description copied from interface: EdgeMap
Associates the given value to the given edge.

Specified by:
set in interface EdgeMap

get

public Object get(Object key)
Description copied from interface: EdgeMap
Returns the value bound to the given edge. The value must have been assiciated to the given 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 EdgeMap

getBool

public boolean getBool(Object edge)
Description copied from interface: EdgeMap
Returns the boolean value bound to the given edge. The value must have been assiciated to the given 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 EdgeMap

getDouble

public double getDouble(Object edge)
Description copied from interface: EdgeMap
Returns the double value bound to the given edge. The value must have been assiciated to the given 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 EdgeMap

getInt

public int getInt(Object edge)
Description copied from interface: EdgeMap
Returns the integer value bound to the given edge. The value must have been assiciated to the given 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 EdgeMap

setBool

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

Specified by:
setBool in interface EdgeMap

setDouble

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

Specified by:
setDouble in interface EdgeMap

setInt

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

Specified by:
setInt in interface EdgeMap