y.util
Class DataProviders

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

public class DataProviders
extends Object

This class provides convenience and transformation services for DataProviders.


Constructor Summary
DataProviders()
           
 
Method Summary
static DataProvider createConstantDataProvider(Object data)
          Returns a DataProvider that returns the given value for each key.
static DataProvider createEdgeDataProvider(boolean[] data)
          Returns a DataProvider view of a boolean array defined for edges.
static DataProvider createEdgeDataProvider(double[] data)
          Returns a DataProvider view of a double array defined for edges.
static DataProvider createEdgeDataProvider(double[] doubleData, int[] intData, boolean[] boolData, Object[] objectData)
          Returns a DataProvider view of a double, int, boolean and Object array defined for edges.
static DataProvider createEdgeDataProvider(int[] data)
           
static DataProvider createEdgeDataProvider(Object[] data)
          Returns a DataProvider view of an Object array defined for edges.
static DataProvider createNegatedDataProvider(DataProvider data)
          Returns a DataProvider that returns the negated boolean values provided by another data provider.
static DataProvider createNodeDataProvider(boolean[] data)
          Returns a DataProvider view of a boolean array defined for nodes.
static DataProvider createNodeDataProvider(double[] data)
          Returns a DataProvider view of a double array defined for nodes.
static DataProvider createNodeDataProvider(double[] doubleData, int[] intData, boolean[] boolData, Object[] objectData)
          Returns a DataProvider view of a double, int, boolean and Object array defined for nodes.
static DataProvider createNodeDataProvider(int[] data)
           
static DataProvider createNodeDataProvider(Object[] data)
          Returns a DataProvider view of an Object array defined for nodes.
static DataProvider createSourceDataProvider(DataProvider nodeData)
          Returns a DataProvider for edges that return the data provider values bound to their source nodes.
static DataProvider createTargetDataProvider(DataProvider nodeData)
          Returns a DataProvider for edges that return the data provider values bound to their target nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataProviders

public DataProviders()
Method Detail

createEdgeDataProvider

public static DataProvider createEdgeDataProvider(double[] data)
Returns a DataProvider view of a double array defined for edges. The double value data[edge.index()] will be returned by the dataprovider upon the method call getDouble(edge).

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

createEdgeDataProvider

public static DataProvider createEdgeDataProvider(int[] data)

createEdgeDataProvider

public static DataProvider createEdgeDataProvider(boolean[] data)
Returns a DataProvider view of a boolean array defined for edges. The boolean value data[edge.index()] will be returned by the dataprovider upon the method call getBool(edge).

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

createEdgeDataProvider

public static DataProvider createEdgeDataProvider(Object[] data)
Returns a DataProvider view of an Object array defined for edges. The Object value data[edge.index()] will be returned by the dataprovider upon the method call get(edge).

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

createEdgeDataProvider

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

The double value doubleData[edge.index()] will be returned by the dataprovider upon the method call getDouble(edge).

The int value intData[edge.index()] will be returned by the dataprovider upon the method call getInt(edge).

The boolean value boolData[edge.index()] will be returned by the dataprovider upon the method call getBool(edge).

The Object value objectData[edge.index()] will be returned by the dataprovider upon the method call get(edge).

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 dataprovider view of the given arrays

createNodeDataProvider

public static DataProvider createNodeDataProvider(double[] data)
Returns a DataProvider view of a double array defined for nodes. The double value data[node.index()] will be returned by the dataprovider upon the method call getDouble(node).

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

createNodeDataProvider

public static DataProvider createNodeDataProvider(int[] data)

createNodeDataProvider

public static DataProvider createNodeDataProvider(boolean[] data)
Returns a DataProvider view of a boolean array defined for nodes. The boolean value data[node.index()] will be returned by the dataprovider upon the method call getBool(node).

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

createNodeDataProvider

public static DataProvider createNodeDataProvider(Object[] data)
Returns a DataProvider view of an Object array defined for nodes. The Object value data[node.index()] will be returned by the dataprovider upon the method call get(node).

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

createNodeDataProvider

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

The double value doubleData[node.index()] will be returned by the dataprovider upon the method call getDouble(node).

The int value intData[node.index()] will be returned by the dataprovider upon the method call getInt(node).

The boolean value boolData[node.index()] will be returned by the dataprovider upon the method call getBool(node).

The Object value objectData[node.index()] will be returned by the dataprovider upon the method call get(node).

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 dataprovider view of the given arrays

createConstantDataProvider

public static DataProvider createConstantDataProvider(Object data)
Returns a DataProvider that returns the given value for each key.

Parameters:
data - constant Object data returned by the created dataprovider.
Returns:
a dataprovider view of a single value.

createSourceDataProvider

public static DataProvider createSourceDataProvider(DataProvider nodeData)
Returns a DataProvider for edges that return the data provider values bound to their source nodes.


createTargetDataProvider

public static DataProvider createTargetDataProvider(DataProvider nodeData)
Returns a DataProvider for edges that return the data provider values bound to their target nodes.


createNegatedDataProvider

public static DataProvider createNegatedDataProvider(DataProvider data)
Returns a DataProvider that returns the negated boolean values provided by another data provider.


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

2003