|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y25.base.LayeredGraph.NodeMapImpl
An Implementation of the NodeMap
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 node. |
boolean |
getBool(Object node)
Returns the boolean value bound to the given node. |
double |
getDouble(Object node)
Returns the double value bound to the given node. |
int |
getInt(Object node)
Returns the integer value bound to the given node. |
Object |
remove(Object node)
Removes the value stored for the given node, if present. |
void |
set(Object key,
Object value)
Associates the given value to the given node. |
void |
setBool(Object node,
boolean value)
Associates the given boolean value to the given node. |
void |
setDouble(Object node,
double value)
Associates the given double value to the given node. |
void |
setInt(Object node,
int value)
Associates the given integer value to the given node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected HashMap map
HashMap
that is used to store key/value pairs.
Method Detail |
public Object remove(Object node)
NodeMap
null
if
there was no mapping for that node. A null
return can also
mean that the map previously associated null
with the
given node.
remove
in interface NodeMap
public void set(Object key, Object value)
NodeMap
set
in interface NodeMap
public Object get(Object key)
NodeMap
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
.
get
in interface NodeMap
public boolean getBool(Object node)
NodeMap
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
.
getBool
in interface NodeMap
public double getDouble(Object node)
NodeMap
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
.
getDouble
in interface NodeMap
public int getInt(Object node)
NodeMap
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
.
getInt
in interface NodeMap
public void setBool(Object node, boolean value)
NodeMap
setBool
in interface NodeMap
public void setDouble(Object node, double value)
NodeMap
setDouble
in interface NodeMap
public void setInt(Object node, int value)
NodeMap
setInt
in interface NodeMap
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |