com.sdm.quasar.client.core.data.impl
Class DefaultDataStructureConfiguration

java.lang.Object
  extended bycom.sdm.quasar.client.core.data.impl.DefaultDataStructureConfiguration
All Implemented Interfaces:
DataConfiguration, DataStructureConfiguration

public class DefaultDataStructureConfiguration
extends java.lang.Object
implements DataStructureConfiguration

Default implementation for DataStructureConfiguration that delegates to a DataCore.

Version:
1.0
Author:
Bernd Olleck, sd&m AG

Constructor Summary
DefaultDataStructureConfiguration(DefaultDataCore dataCore)
          Constructor
 
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.
 void addNode(Node node)
          Configures a new node
 Node getNode(java.lang.String key)
          Returns the node configured for the given key
 java.util.Set getNodeKeys()
           
 boolean hasNode(java.lang.String key)
          Tests whether a node has been configured
 Node removeNode(java.lang.String key)
          Removes a node and all nodes that depend on it
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataStructureConfiguration

public DefaultDataStructureConfiguration(DefaultDataCore dataCore)
Constructor

Parameters:
dataCore - the data core to delegate to
Method Detail

addBaseNode

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

Specified by:
addBaseNode in interface DataStructureConfiguration
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)
Description copied from interface: DataStructureConfiguration
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.

Specified by:
addAspectNode in interface DataStructureConfiguration
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)
Description copied from interface: DataStructureConfiguration
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.

Specified by:
addComputedNode in interface DataStructureConfiguration
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)
Description copied from interface: DataStructureConfiguration
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.

Specified by:
addIndexedNode in interface DataStructureConfiguration
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

hasNode

public boolean hasNode(java.lang.String key)
Description copied from interface: DataConfiguration
Tests whether a node has been configured

Specified by:
hasNode in interface DataConfiguration
Parameters:
key - the key of the node
Returns:
true iff the node has been defined

getNode

public Node getNode(java.lang.String key)
Description copied from interface: DataConfiguration
Returns the node configured for the given key

Specified by:
getNode in interface DataConfiguration
Parameters:
key - the key of the node
Returns:
the node for the key

removeNode

public Node removeNode(java.lang.String key)
Description copied from interface: DataConfiguration
Removes a node and all nodes that depend on it

Specified by:
removeNode in interface DataConfiguration
Parameters:
key - the key of the node to remove
Returns:
the node that has been removed

addNode

public void addNode(Node node)
Description copied from interface: DataConfiguration
Configures a new node

Specified by:
addNode in interface DataConfiguration
Parameters:
node - the node that should be added

getNodeKeys

public java.util.Set getNodeKeys()
Specified by:
getNodeKeys in interface DataConfiguration
Returns:
the set of the keys of all nodes.