Search this API

y.util
Class DataProviders

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

public class DataProviders
extends java.lang.Object

This class provides convenience and transformation services for DataProviders.

 

Nested Class Summary
static class DataProviders.DataProviderOverlayManager
          This helper class can be used to overlay DataProviders registered at a graph with another DataProvider.
 
Constructor Summary
DataProviders()
           
 
Method Summary
static DataProvider createConstantDataProvider(java.lang.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, java.lang.Object[] objectData)
          Returns a DataProvider view of a double, int, boolean and Object array defined for edges.
static DataProvider createEdgeDataProvider(int[] data)
          Returns a DataProvider view of an int array defined for edges.
static DataProvider createEdgeDataProvider(java.lang.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, java.lang.Object[] objectData)
          Returns a DataProvider view of a double, int, boolean and Object array defined for nodes.
static DataProvider createNodeDataProvider(int[] data)
          Returns a DataProvider view of an int array defined for nodes.
static DataProvider createNodeDataProvider(java.lang.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 data provider upon the method call getDouble(edge).

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

createEdgeDataProvider

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

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

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 data provider upon the method call getBool(edge).

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

createEdgeDataProvider

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

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

createEdgeDataProvider

public static DataProvider createEdgeDataProvider(double[] doubleData,
                                                  int[] intData,
                                                  boolean[] boolData,
                                                  java.lang.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 data provider upon the method call getDouble(edge).

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

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

The Object value objectData[edge.index()] will be returned by the data provider 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 data provider 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 data provider upon the method call getDouble(node).

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

createNodeDataProvider

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

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

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 data provider upon the method call getBool(node).

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

createNodeDataProvider

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

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

createNodeDataProvider

public static DataProvider createNodeDataProvider(double[] doubleData,
                                                  int[] intData,
                                                  boolean[] boolData,
                                                  java.lang.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 data provider upon the method call getDouble(node).

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

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

The Object value objectData[node.index()] will be returned by the data provider 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 data provider view of the given arrays

createConstantDataProvider

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

Parameters:
data - constant Object data returned by the created data provider.
Returns:
a data provider 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-2017,
yWorks GmbH.
All rights reserved.