Search this API

y.util
Class Maps

java.lang.Object
  extended by y.util.Maps

public class Maps
extends java.lang.Object

This class provides convenience and transformation services for NodeMaps, EdgeMaps and DataMaps.

 

Nested Class Summary
static class Maps.HighPerformanceBoolMap
          Implementation of a resettable high performance map for values of simple type boolean.
static class Maps.HighPerformanceDoubleMap
          Implementation of a resettable high performance map for values of simple type double.
static class Maps.HighPerformanceIntMap
          Implementation of a resettable high performance map for values of simple type int.
static class Maps.HighPerformanceObjectMap
          Implementation of a resettable high performance map for values of type Object.
 
Constructor Summary
Maps()
           
 
Method Summary
static DataMap createDataMap(java.util.Map map)
          Create a DataMap view of the given map.
static EdgeMap createEdgeMap(java.util.Map map)
          Create an EdgeMap view of the given map.
static DataMap createHashedDataMap()
          Creates a DataMap that is based on hashing.
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, java.lang.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(java.lang.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, java.lang.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(java.lang.Object[] data)
          Returns a NodeMap view of an Object array defined for nodes.
static NodeMap createNodeMap(java.util.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 map.

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 map.

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(java.lang.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 map.

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,
                                         java.lang.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 map.

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 map.

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 map.

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 map.

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

createIndexEdgeMap

public static EdgeMap createIndexEdgeMap(java.lang.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 map.

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,
                                         java.lang.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 map.

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(java.util.Map map)
Create a NodeMap view of the given map. Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer 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(java.util.Map map)
Create an EdgeMap view of the given map. Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the given map.


createHashedDataMap

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


createDataMap

public static DataMap createDataMap(java.util.Map map)
Create a DataMap view of the given map. Accessing basic value types is solved by storing the corresponding wrapper types Double, Integer and Boolean within the given map.


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