Package com.qfs.agg
Interface IGenericAggregationFunction
-
- All Superinterfaces:
IPluginValue,Serializable
- All Known Subinterfaces:
IAggregationFunction,IHistoryAggregationFunction,IMultiSourceAggregationFunction,IUserDefinedAggregateFunction
- All Known Implementing Classes:
AAggregationFunction,AGenericAggregationFunction,AGenericBaseAggregationFunction,AGenericVectorAggregationFunction,AMultiSourceAggregationFunction,AUserDefinedAggregateFunction,AUserDefinedAggregateFunctionWithRemoval,AVarianceAggregateFunction,AVectorAggregationFunction,AvgFunction,ComparableMaxFunction,CopyFunction,CountFunction,DistinctCountFunction,DistinctCountSupportingRemovalsFunction,GrossSumFunction,LongFunction,MaxFunction,MaxHistoryFunction,MedianFunction,MinFunction,MinHistoryFunction,MultiplyFunction,PercentileFunction,PopulationStdAggregateFunction,PopulationVarianceAggregateFunction,SampleStdAggregateFunction,SampleVarianceAggregateFunction,SerializableUserDefinedAggregateFunction,SerializableUserDefinedAggregateFunctionWithRemoval,SerializableUserDefinedVectorAggregateFunction,SerializableUserDefinedVectorAggregateFunctionWithRemoval,ShortFunction,SingleValueFunction,SquareSumFunction,SumFunction,SumProductFunction,TimestampFunction
public interface IGenericAggregationFunction extends IPluginValue, Serializable
Generic Aggregation function based on an arbitrary number of data sources.It is recommended for clients implementing their own aggregation functions to either start with
AAggregationFunctionorAMultiSourceAggregationFunction.- Author:
- ActiveViam
-
-
Field Summary
Fields Modifier and Type Field Description static StringSUM_PRODUCT_FUNCTION_PLUGIN_KEYPlugin value key for an aggregation function that produces the sum product of the sources it is given.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description IGenericAggregationcreateAggregation(List<String> sourceIdentifiers, int[] sourceTypes)Creates anIGenericAggregationthat can bind a list of data structures to a single destination data structure.intgetAggregatedType(int[] sourceTypes)static <T extends IGenericAggregationFunction>
TgetFunction(String pluginKey)Returns theIGenericAggregationFunctionassociated with this plugin using the input key.IGenericAggregationFunctionwithRemovalSupport()Returns thefunctionthat supports removal, i.e.-
Methods inherited from interface com.quartetfs.fwk.types.IPluginValue
description, getPlugin, key, setPlugin
-
-
-
-
Field Detail
-
SUM_PRODUCT_FUNCTION_PLUGIN_KEY
static final String SUM_PRODUCT_FUNCTION_PLUGIN_KEY
Plugin value key for an aggregation function that produces the sum product of the sources it is given.This aggregation is only defined for numerical types, nullable or not.
nullvalues will simply be skipped.This aggregation also accepts a single numerical vector type, as long as it comes last in the list of sources to aggregate.
Example with table Trade:
┌─────────────────┬──────────┬───────┐ │ Underlying │ Quantity │ Value │ ├────────────────┼──────────┼────────┤ │ AAPL │ 10 │ 7.4 │ │ AAPL │ 15 │ 2.0 │ │ AAPL │ 1 │ 5.33 │ │ AAPL │ 12 │ 6.0 │ └───────────────┴────────────────────┘
SumProduct(Quantity, Value) will output:Result = 10 * 7.4 + 15 * 2.0 + 1 * 5.33 + 12 * 6.0 = 181.33
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAggregatedType
int getAggregatedType(int[] sourceTypes)
- Parameters:
sourceTypes- Thedata typesof the elements to be aggregated- Returns:
- the
typeof the result of this aggregation
-
createAggregation
IGenericAggregation createAggregation(List<String> sourceIdentifiers, int[] sourceTypes)
Creates anIGenericAggregationthat can bind a list of data structures to a single destination data structure.The created aggregation is specialized for the given source identifiers, which can then be used to retrieve the correct source data structures to bind with a destination.
The two given collections must have the same size.
- Parameters:
sourceIdentifiers- A way to identify the source data structuressourceTypes- Thedata typesof the elements to be aggregated- Returns:
- the newly created aggregation, tailored for the given identifiers and types
-
withRemovalSupport
IGenericAggregationFunction withRemovalSupport()
Returns thefunctionthat supports removal, i.e. disaggregation operation for this function.- Returns:
- The created
aggregation function
-
getFunction
static <T extends IGenericAggregationFunction> T getFunction(String pluginKey)
Returns theIGenericAggregationFunctionassociated with this plugin using the input key.This method uses the current registry obtained through
Registry.getRegistry().- Parameters:
pluginKey- The target function's plugin key- Returns:
- The target function
-
-