y.util
Class Maps

java.lang.Object
  |
  +--y.util.Maps

public class Maps
extends Object

This class provides convenience and transformation services for Node- and EdgeMaps.


Constructor Summary
Maps()
           
 
Method Summary
static EdgeMap createEdgeMap(Map map)
          Create an EdgeMap view of the given map.
static EdgeMap createHashedEdgeMap()
          Creates an EdgeMap that is based on hashing.
static NodeMap createHashedNodeMap()
          Creates a NodeMap that is based on hashing.
static EdgeMap createIndexEdgeMap(boolean[] data)
          Returns a EdgeMap view of a boolean array defined for edges.
static EdgeMap createIndexEdgeMap(double[] data)
          Returns a EdgeMap view of a double array defined for edges.
static EdgeMap createIndexEdgeMap(double[] doubleData, int[] intData, boolean[] boolData, Object[] objectData)
          Returns a EdgeMap view of a double, int, boolean and Object array defined for edges.
static EdgeMap createIndexEdgeMap(int[] data)
          Returns a EdgeMap view of an int array defined for edges.
static EdgeMap createIndexEdgeMap(Object[] data)
          Returns a EdgeMap view of an Object array defined for edges.
static NodeMap createIndexNodeMap(boolean[] data)
          Returns a NodeMap view of a boolean array defined for nodes.
static NodeMap createIndexNodeMap(double[] data)
          Returns a NodeMap view of a double array defined for nodes.
static NodeMap createIndexNodeMap(double[] doubleData, int[] intData, boolean[] boolData, Object[] objectData)
          Returns a NodeMap view of a double, int, boolean and Object array defined for nodes.
static NodeMap createIndexNodeMap(int[] data)
          Returns a NodeMap view of an int array defined for nodes.
static NodeMap createIndexNodeMap(Object[] data)
          Returns a NodeMap view of an Object array defined for nodes.
static NodeMap createNodeMap(Map map)
          Create a NodeMap view of the given map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Maps

public Maps()
Method Detail

createIndexNodeMap

public static NodeMap createIndexNodeMap(double[] data)
Returns a NodeMap view of a double array defined for nodes. The double value data[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and setDouble(node,value).

Warning! The indices of the accessed nodes must not change during the use of this NodeMap.

Parameters:
data - array data for each node of a static graph
Returns:
a NodeMap view of the given array

createIndexNodeMap

public static NodeMap createIndexNodeMap(int[] data)
Returns a NodeMap view of an int array defined for nodes. The int value data[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and setInt(node,value). Warning! The indices of the accessed nodes must not change during the use of this NodeMap.

Parameters:
data - array data for each node of a static graph
Returns:
a NodeMap view of the given array

createIndexNodeMap

public static NodeMap createIndexNodeMap(boolean[] data)
Returns a NodeMap view of a boolean array defined for nodes. The boolean value data[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and setBool(node,value).

Parameters:
data - array data for each node of a static graph
Returns:
a NodeMap view of the given array

createIndexNodeMap

public static NodeMap createIndexNodeMap(Object[] data)
Returns a NodeMap view of an Object array defined for nodes. The Object value data[node.index()] will be accessed by the NodeMap upon the method calls get(node) and set(node,value). Warning! The indices of the accessed nodes must not change during the use of this NodeMap.

Parameters:
data - array data for each node of a static graph
Returns:
a NodeMap view of the given array

createIndexNodeMap

public static NodeMap createIndexNodeMap(double[] doubleData,
                                         int[] intData,
                                         boolean[] boolData,
                                         Object[] objectData)
Returns a NodeMap view of a double, int, boolean and Object array defined for nodes.

The double value doubleData[node.index()] will be accessed by the NodeMap upon the method calls getDouble(node) and setDouble(node,value).

The int value intData[node.index()] will be accessed by the NodeMap upon the method calls getInt(node) and setInt(node,value).

The boolean value boolData[node.index()] will be accessed by the NodeMap upon the method calls getBool(node) and setBool(node,value).

The Object value objectData[node.index()] will be accessed by the NodeMap upon the method calls get(node) and set(node,value).

Warning! The indices of the accessed nodes must not change during the use of this NodeMap.

Parameters:
doubleData - double data for each node of a static graph
intData - int data for each node of a static graph
boolData - boolean data for each node of a static graph
objectData - Object data for each node of a static graph
Returns:
a NodeMap view of the given arrays

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(double[] data)
Returns a EdgeMap view of a double array defined for edges. The double value data[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and setDouble(edge,value).

Warning! The indices of the accessed edges must not change during the use of this EdgeMap.

Parameters:
data - array data for each edge of a static graph
Returns:
a EdgeMap view of the given array

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(int[] data)
Returns a EdgeMap view of an int array defined for edges. The int value data[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and setInt(edge,value).

Warning! The indices of the accessed edges must not change during the use of this EdgeMap.

Parameters:
data - array data for each edge of a static graph
Returns:
a EdgeMap view of the given array

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(boolean[] data)
Returns a EdgeMap view of a boolean array defined for edges. The boolean value data[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and setBool(edge,value).

Warning! The indices of the accessed edges must not change during the use of this EdgeMap.

Parameters:
data - array data for each edge of a static graph
Returns:
a EdgeMap view of the given array

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(Object[] data)
Returns a EdgeMap view of an Object array defined for edges. The Object value data[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and set(edge,value).

Warning! The indices of the accessed edges must not change during the use of this EdgeMap.

Parameters:
data - array data for each edge of a static graph
Returns:
a EdgeMap view of the given array

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(double[] doubleData,
                                         int[] intData,
                                         boolean[] boolData,
                                         Object[] objectData)
Returns a EdgeMap view of a double, int, boolean and Object array defined for edges.

The double value doubleData[edge.index()] will be accessed by the EdgeMap upon the method calls getDouble(edge) and setDouble(edge,value).

The int value intData[edge.index()] will be accessed by the EdgeMap upon the method calls getInt(edge) and setInt(edge,value).

The boolean value boolData[edge.index()] will be accessed by the EdgeMap upon the method calls getBool(edge) and setBool(edge,value).

The Object value objectData[edge.index()] will be accessed by the EdgeMap upon the method calls get(edge) and set(edge,value).

Warning! The indices of the accessed edges must not change during the use of this EdgeMap.

Parameters:
doubleData - double data for each edge of a static graph
intData - int data for each edge of a static graph
boolData - boolean data for each edge of a static graph
objectData - Object data for each edge of a static graph
Returns:
a EdgeMap view of the given arrays

createHashedNodeMap

public static NodeMap createHashedNodeMap()
Creates a NodeMap that is based on hashing. The preconditions specified in java.util.HashMap apply for the keys and values of this map.


createNodeMap

public static NodeMap createNodeMap(Map map)
Create a NodeMap view of the given map. Accessing basic value types is solved by storing the corresponding wrapper types Double, Interger and Boolean within the given Map.


createHashedEdgeMap

public static EdgeMap createHashedEdgeMap()
Creates an EdgeMap that is based on hashing. The preconditions specified in java.util.HashMap apply for the keys and values of this map.


createEdgeMap

public static EdgeMap createEdgeMap(Map map)
Create an EdgeMap view of the given map. Accessing basic value types is solved by storing the corresponding wrapper types Double, Interger and Boolean within the given Map.


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

2003