|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides access to data associated with an edge. A edge map can be considered as a map that allows only edges as keys. The edges used as keys for the getter/setter methods must belong to the same layered graph.
The values bound to the edges are initialized with Java(TM) default values(null, 0, 0.0, false) upon initialization.
This interface exists primarily because the original interface
y.base.EdgeMap
only allows edges that belong to the
same graph as keys. This restriction is not posed by this interface. When
working with layered graphs, there might be a situation where one EdgeMap
should store information about edges from different graphs (wich all belong
to the same layered graph) - and this is where this interface comes into
play.
There is also another reason why this interface exists: orthogonality. The
newly defined interfaces GraphMap
and LayerEdgeMap
both have
a remove
method, which is not true for the original
y.base.NodeMap
or
y.base.EdgeMap
.
Method Summary | |
Object |
get(Object edge)
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 edge,
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. |
Method Detail |
public Object remove(Object edge)
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.
public Object get(Object edge)
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 EdgeMap
public boolean getBool(Object edge)
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 EdgeMap
public double getDouble(Object edge)
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 EdgeMap
public int getInt(Object edge)
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 EdgeMap
public void set(Object edge, Object value)
set
in interface EdgeMap
public void setBool(Object edge, boolean value)
setBool
in interface EdgeMap
public void setDouble(Object edge, double value)
setDouble
in interface EdgeMap
public void setInt(Object edge, int value)
setInt
in interface EdgeMap
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |