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

All Known Implementing Classes:
AbstractSimpleComputation, ContextNodeComputation

public interface Computation

Defines a computation used within a ComputedNode. If you want to implement a computation that does not need a context you should use AbstractSimpleComputation as base class.

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

Method Summary
 java.util.Set computeIndexSet(ComputationValueAccess sourceValuesAccess, Context context)
          Performs the computation of a Set of the index values.
 java.lang.Object computeValue(ComputationValueAccess sourceValuesAccess, Context context)
          Performs the computation with an context.
 java.lang.Class[] getSourceTypes()
           
 java.lang.Class getType()
           
 void reverseValueComputation(java.lang.Object targetValue, ComputationValueAccess sourceValuesAccess, Context context)
          Perform a reverse computation computes the correct source values with respect to the target value with a context.
 boolean supportsReverse()
           
 

Method Detail

getType

public java.lang.Class getType()
Returns:
the type of the result that this computation produces

getSourceTypes

public java.lang.Class[] getSourceTypes()
Returns:
the types of the source values that this compuatation expects

computeValue

public java.lang.Object computeValue(ComputationValueAccess sourceValuesAccess,
                                     Context context)
Performs the computation with an context.

Parameters:
sourceValuesAccess - the access source values
context - the context to be used
Returns:
the result

computeIndexSet

public java.util.Set computeIndexSet(ComputationValueAccess sourceValuesAccess,
                                     Context context)
Performs the computation of a Set of the index values. The method returns null for not indexed nodes.

Parameters:
sourceValuesAccess - the access source values
context - the context to be used
Returns:
a Set of the index values or null

supportsReverse

public boolean supportsReverse()
Returns:
true iff the computation supports a reverse computation

reverseValueComputation

public void reverseValueComputation(java.lang.Object targetValue,
                                    ComputationValueAccess sourceValuesAccess,
                                    Context context)
Perform a reverse computation computes the correct source values with respect to the target value with a context. The resulting new source values must be set using the ComputationValueAccess.

Parameters:
targetValue - the target value
sourceValuesAccess - the access current source values
context - the context to be used