y.base
Interface NodeMap

All Superinterfaces:
DataAcceptor, DataProvider
All Known Implementing Classes:
NodeMapAdapter

public interface NodeMap
extends DataProvider, DataAcceptor

Provides access to data associated with a node. A node map can be considered as a map that allows only nodes as keys. Node keys of a node map must belong to the same graph.

There are data accessor methods defined for the most common typed values as well.

The node values are initialized with java default values (null, 0, 0.0, false) upon initialisation.


Method Summary
 Object get(Object node)
          Returns the value bound to the given node.
 boolean getBool(Object key)
          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.
 void set(Object node, 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.
 

Method Detail

set

public void set(Object node,
                Object value)
Associates the given value to the given node.

Specified by:
set in interface DataAcceptor

get

public Object get(Object node)
Returns the value bound to the given node.

Specified by:
get in interface DataProvider

setBool

public void setBool(Object node,
                    boolean value)
Associates the given boolean value to the given node.

Specified by:
setBool in interface DataAcceptor

getBool

public boolean getBool(Object key)
Returns the boolean value bound to the given node.

Precondition: The value must have been associated to the given node by a call to setBool.

Specified by:
getBool in interface DataProvider

setDouble

public void setDouble(Object node,
                      double value)
Associates the given double value to the given node.

Specified by:
setDouble in interface DataAcceptor

getDouble

public double getDouble(Object node)
Returns the double value bound to the given node.

Precondition: The value must have been associated to the given node by a call to setDouble.

Specified by:
getDouble in interface DataProvider

setInt

public void setInt(Object node,
                   int value)
Associates the given integer value to the given node.

Specified by:
setInt in interface DataAcceptor

getInt

public int getInt(Object node)
Returns the integer value bound to the given node.

Precondition: The value must have been associated to the given node by a call to setInt.

Specified by:
getInt in interface DataProvider

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003