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
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 AAggregationFunction or AMultiSourceAggregationFunction.
- Author:
- ActiveViam
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPlugin value key for an aggregation function that produces the sum product of the sources it is given. -
Method Summary
Modifier and TypeMethodDescriptioncreateAggregation(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.Returns thefunctionthat supports removal, i.e.Methods inherited from interface com.quartetfs.fwk.types.IPluginValue
description, getPlugin, key, setPlugin
-
Field Details
-
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:
-
-
Method Details
-
getAggregatedType
int getAggregatedType(int[] sourceTypes) - Parameters:
sourceTypes- Thedata typesof the elements to be aggregated- Returns:
- the
typeof the result of this aggregation
-
createAggregation
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
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
-