Home Up

Map
Pattern Data Node and Model Map Algorithm Parameters Events

 

The Map Interface

 

The Map interface represents the actual map.  Since the map is made up of nodes and models, the Map interface specifies methods for accessing and setting the nodes and models.  It also specifies methods for accessing and setting the topology of the nodes.

Figure 1.  UML diagram for the Map interface.

A Map implementation is meant to store and provide access to the nodes, models, and node topology of the map.  Implementations are free to store the objects in any way, as long as the nodes and models are accessible by an integer index, and the Iterator returned by the getConnectedNodes method returns the actual Node objects that the specified node is connected to.

JSOMap provides a basic implementation of the Map interface, called BasicMap.  This implementation provides the storage and access to the nodes, models, and topology required by the Map interface.  Additionally, it contains an add method that can be used to build the map one node-model pair at a time.  Note also that BasicMap can store any type of Node and Model implementation, since it only refers to the Node and Model interfaces.

Figure 2.  UML diagram for the Map implementations.

Traditionally, the map consists of nodes and models represented by vectors.  The TraditionalMap class contains a single constructor that accepts a DoubleData object containing the node vectors, a DoubleData object containing the initial model vectors, and an IntegerData object representing an adjacency matrix for the node topology.  TraditionalMap uses a BasicMap instance for the actual map storage.

JSOMap also provides a fully synchronized Map implementation, called SynchronizedMap.  All methods in SynchronizedMap are declared as synchronized so only one thread can access the object at a single time.  The SynchronizedMap must be manually synchronized when iterating over the connected nodes; see the javadoc documentation for SynchronizedMap for more details.

 

 

SourceForge.net Logo

Send mail to zcox@iastate.edu with questions or comments about this web site.
Last modified: March 04, 2002