com.sdm.quasar.client.core.data.structure
Interface DataStructureConfiguration

All Superinterfaces:
DataConfiguration
All Known Implementing Classes:
DefaultDataStructureConfiguration

public interface DataStructureConfiguration
extends DataConfiguration

Adds convenience methods to DataConfiguration that define the structure of the DataManager using DataConfiguration.addNode(Node).


Method Summary
 AspectNode addAspectNode(java.lang.String key, java.lang.String sourceKey, java.lang.Class sourceType, java.lang.String aspectName, java.lang.Class aspectType)
          Registers an aspect node that depends on one source value and provides the value of an aspect of that value.
 BaseNode addBaseNode(java.lang.String key, java.lang.Class type)
          Registers a base node that does not depend on any other node and holds a value of the given type.
 ComputedNode addComputedNode(java.lang.String key, java.lang.String[] sourceKeys, Computation computation)
          Registers a computed node that depends on one or more source values and is defined by a Computation.
 IndexedNode addIndexedNode(java.lang.String key, java.lang.String sourceKey, java.lang.Class sourceType, java.lang.Class indexType, java.lang.Class type)
          Registers an indexed node that depends on one source value and provides indexed access to the value.
 
Methods inherited from interface com.sdm.quasar.client.core.data.structure.DataConfiguration
addNode, getNode, getNodeKeys, hasNode, removeNode
 

Method Detail

addBaseNode

public BaseNode addBaseNode(java.lang.String key,
                            java.lang.Class type)
Registers a base node that does not depend on any other node and holds a value of the given type.

Parameters:
key - the key of the node to create
type - the type that this node holds
Returns:
the node that has been added

addAspectNode

public AspectNode addAspectNode(java.lang.String key,
                                java.lang.String sourceKey,
                                java.lang.Class sourceType,
                                java.lang.String aspectName,
                                java.lang.Class aspectType)
Registers an aspect node that depends on one source value and provides the value of an aspect of that value. This is usally an attribute of an object.

Parameters:
key - the key of the node to create
sourceKey - the key of the node that holds the source value
sourceType - the type of the value that is expected from the source node
aspectName - the name of the aspect, i.e. the name of the attribute of the source value
aspectType - the type that the aspect guarantees to have. This is usually the type of the attribute but it may be narrowed to a type that is assignable to the type of the attribute.
Returns:
the node that has been added

addComputedNode

public ComputedNode addComputedNode(java.lang.String key,
                                    java.lang.String[] sourceKeys,
                                    Computation computation)
Registers a computed node that depends on one or more source values and is defined by a Computation. When computed, the values of the nodes that are defined by the source keys are passed to the Computation in the order the keys are defined in this method.

Parameters:
key - the key of the node to create
sourceKeys - the keys of the nodes in the order that the computation depends on
computation - the computation rule
Returns:
the node that has been added

addIndexedNode

public IndexedNode addIndexedNode(java.lang.String key,
                                  java.lang.String sourceKey,
                                  java.lang.Class sourceType,
                                  java.lang.Class indexType,
                                  java.lang.Class type)
Registers an indexed node that depends on one source value and provides indexed access to the value. The source value must be a collection of data of some type supported by the DataManagerPlugIns of the DataManager.

Parameters:
key - the key of the node to create
sourceKey - the key of the source node that provides the collection
sourceType - the type of the source value
indexType - the type of the index values
type - the type of the values in the collection
Returns:
the node that has been added