Class DynamicTenorsAndMaturitiesPostProcessor

  • All Implemented Interfaces:
    IMaturityConverterAware, ITenorUtilAware, ICustomParametersAware, com.quartetfs.biz.pivot.postprocessing.IAggregatedMeasureAware, com.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>, com.quartetfs.fwk.types.IExtendedPluginValue, Serializable

    @QuartetExtendedPluginValue(intf=com.quartetfs.biz.pivot.postprocessing.IPostProcessor.class,
                                key="DYNAMIC_TENORS_AND_MATURITIES")
    public class DynamicTenorsAndMaturitiesPostProcessor
    extends com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor<Double>
    implements ITenorUtilAware, IMaturityConverterAware, ICustomParametersAware
    Postprocessor that dynamically buckets from an input tenor and maturity to the appropriate destination tenors and maturities. Can be configured to bucket on a single dimension (either tenors or maturities).
    See Also:
    Serialized Form
    • Constructor Detail

      • DynamicTenorsAndMaturitiesPostProcessor

        public DynamicTenorsAndMaturitiesPostProcessor​(String name,
                                                       com.quartetfs.biz.pivot.cube.hierarchy.measures.IPostProcessorCreationContext creationContext)
    • Method Detail

      • getPostProcessorDescription

        public static Function<com.activeviam.desc.build.ICanStartBuildingMeasures,​com.activeviam.desc.build.IHasAtLeastOneMeasure> getPostProcessorDescription​(String measureName,
                                                                                                                                                                      String underlyingMeasure,
                                                                                                                                                                      String sensiType,
                                                                                                                                                                      String dynamicTenorHierarchy,
                                                                                                                                                                      String[] sourceTenorsLevel,
                                                                                                                                                                      BucketType inputTenorsBucketType,
                                                                                                                                                                      BucketType dynamicTenorsBucketType,
                                                                                                                                                                      String tenorAndMaturityDefaultValue,
                                                                                                                                                                      String asOfDateLevel,
                                                                                                                                                                      String sensitivityNameLvl,
                                                                                                                                                                      String formatter,
                                                                                                                                                                      String folder)
        One axis flavor
        Parameters:
        measureName - The name of the resulting measure.
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        sourceTenorsLevel - The source tenor level.
        inputTenorsBucketType - input tenors bucket level
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        formatter - The formatter.
        folder - The folder.
        Returns:
        The fluent API calls required to build the measure.
      • measure

        public static com.activeviam.copper.api.CopperMeasure measure​(com.activeviam.copper.api.CopperMeasure underlyingMeasure,
                                                                      String sensiType,
                                                                      String dynamicTenorHierarchy,
                                                                      String[] sourceTenorsLevel,
                                                                      BucketType inputTenorsBucketType,
                                                                      BucketType dynamicTenorsBucketType,
                                                                      String tenorAndMaturityDefaultValue,
                                                                      String asOfDateLevel,
                                                                      String sensitivityNameLvl)
        One axis flavor
        Parameters:
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        sourceTenorsLevel - The source tenor level.
        inputTenorsBucketType - input tenors bucket level
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        Returns:
        The copper measure.
      • getPostProcessorDescription

        public static Function<com.activeviam.desc.build.ICanStartBuildingMeasures,​com.activeviam.desc.build.IHasAtLeastOneMeasure> getPostProcessorDescription​(String measureName,
                                                                                                                                                                      String underlyingMeasure,
                                                                                                                                                                      String sensiType,
                                                                                                                                                                      String dynamicTenorHierarchy,
                                                                                                                                                                      String dynamicMaturityHierarchy,
                                                                                                                                                                      String[] sourceTenorsLevel,
                                                                                                                                                                      String[] sourceMaturitiesLevel,
                                                                                                                                                                      BucketType inputTenorsBucketType,
                                                                                                                                                                      BucketType dynamicTenorsBucketType,
                                                                                                                                                                      BucketType inputMaturitiesBucketType,
                                                                                                                                                                      BucketType dynamicMaturitiesBucketType,
                                                                                                                                                                      String tenorAndMaturityDefaultValue,
                                                                                                                                                                      String asOfDateLevel,
                                                                                                                                                                      String sensitivityNameLvl,
                                                                                                                                                                      String formatter,
                                                                                                                                                                      String folder)
        Two axis flavor
        Parameters:
        measureName - The name of the resulting measure.
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        dynamicMaturityHierarchy - The destination maturity hierarchy.
        sourceTenorsLevel - The source tenor level.
        sourceMaturitiesLevel - The source maturities level.
        inputTenorsBucketType - input tenors bucket type
        inputMaturitiesBucketType - input maturities bucket type
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        dynamicMaturitiesBucketType - The type of the dynamic maturity bucket.
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        formatter - The formatter.
        folder - The folder.
        Returns:
        The fluent API calls required to build the measure.
      • measure

        public static com.activeviam.copper.api.CopperMeasure measure​(com.activeviam.copper.api.CopperMeasure underlyingMeasure,
                                                                      String sensiType,
                                                                      String dynamicTenorHierarchy,
                                                                      String dynamicMaturityHierarchy,
                                                                      String[] sourceTenorsLevel,
                                                                      String[] sourceMaturitiesLevel,
                                                                      BucketType inputTenorsBucketType,
                                                                      BucketType dynamicTenorsBucketType,
                                                                      BucketType inputMaturitiesBucketType,
                                                                      BucketType dynamicMaturitiesBucketType,
                                                                      String tenorAndMaturityDefaultValue,
                                                                      String asOfDateLevel,
                                                                      String sensitivityNameLvl)
        Two axis flavor
        Parameters:
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        dynamicMaturityHierarchy - The destination maturity hierarchy.
        sourceTenorsLevel - The source tenor level.
        sourceMaturitiesLevel - The source maturities level.
        inputTenorsBucketType - input tenors bucket type
        inputMaturitiesBucketType - input maturities bucket type
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        dynamicMaturitiesBucketType - The type of the dynamic maturity bucket.
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        Returns:
        The copper measure.
      • getPostProcessorDescription

        public static Function<com.activeviam.desc.build.ICanStartBuildingMeasures,​com.activeviam.desc.build.IHasAtLeastOneMeasure> getPostProcessorDescription​(String measureName,
                                                                                                                                                                      String underlyingMeasure,
                                                                                                                                                                      String sensiType,
                                                                                                                                                                      String dynamicTenorHierarchy,
                                                                                                                                                                      String dynamicMaturityHierarchy,
                                                                                                                                                                      String dynamicMoneynessHierarchy,
                                                                                                                                                                      String[] sourceTenorsLevel,
                                                                                                                                                                      String[] sourceMaturitiesLevel,
                                                                                                                                                                      String[] sourceMoneynessLevel,
                                                                                                                                                                      BucketType inputTenorsBucketType,
                                                                                                                                                                      BucketType dynamicTenorsBucketType,
                                                                                                                                                                      BucketType inputMaturitiesBucketType,
                                                                                                                                                                      BucketType dynamicMaturitiesBucketType,
                                                                                                                                                                      BucketType inputMoneynessBucketType,
                                                                                                                                                                      BucketType dynamicMoneynessBucketType,
                                                                                                                                                                      String tenorAndMaturityDefaultValue,
                                                                                                                                                                      String asOfDateLevel,
                                                                                                                                                                      String sensitivityNameLvl,
                                                                                                                                                                      String formatter,
                                                                                                                                                                      String folder)
        Three axis flavor
        Parameters:
        measureName - The name of the resulting measure.
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        dynamicMaturityHierarchy - The destination maturity hierarchy.
        dynamicMoneynessHierarchy - dynamic moneyness hierarchy
        sourceTenorsLevel - The source tenor level.
        sourceMaturitiesLevel - The source maturities level.
        sourceMoneynessLevel - source moneyness level
        inputTenorsBucketType - input tenors bucket type
        inputMaturitiesBucketType - input maturities bucket type
        inputMoneynessBucketType - inpyt moneyness bucket type
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        dynamicMaturitiesBucketType - The type of the dynamic maturity bucket.
        dynamicMoneynessBucketType - dynamic moneyness bucket type
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        formatter - The formatter.
        folder - The folder.
        Returns:
        The fluent API calls required to build the measure.
      • measure

        public static com.activeviam.copper.api.CopperMeasure measure​(com.activeviam.copper.api.CopperMeasure underlyingMeasure,
                                                                      String sensiType,
                                                                      String dynamicTenorHierarchy,
                                                                      String dynamicMaturityHierarchy,
                                                                      String dynamicMoneynessHierarchy,
                                                                      String[] sourceTenorsLevel,
                                                                      String[] sourceMaturitiesLevel,
                                                                      String[] sourceMoneynessLevel,
                                                                      BucketType inputTenorsBucketType,
                                                                      BucketType dynamicTenorsBucketType,
                                                                      BucketType inputMaturitiesBucketType,
                                                                      BucketType dynamicMaturitiesBucketType,
                                                                      BucketType inputMoneynessBucketType,
                                                                      BucketType dynamicMoneynessBucketType,
                                                                      String tenorAndMaturityDefaultValue,
                                                                      String asOfDateLevel,
                                                                      String sensitivityNameLvl)
        Three axis flavor
        Parameters:
        underlyingMeasure - The measure to be re-bucketed.
        sensiType - The type of the sensitivity.
        dynamicTenorHierarchy - The destination tenor hierarchy.
        dynamicMaturityHierarchy - The destination maturity hierarchy.
        dynamicMoneynessHierarchy - dynamic moneyness hierarchy
        sourceTenorsLevel - The source tenor level.
        sourceMaturitiesLevel - The source maturities level.
        sourceMoneynessLevel - source moneyness level
        inputTenorsBucketType - input tenors bucket type
        inputMaturitiesBucketType - input maturities bucket type
        inputMoneynessBucketType - inpyt moneyness bucket type
        dynamicTenorsBucketType - The type of the dynamic tenor bucket.
        dynamicMaturitiesBucketType - The type of the dynamic maturity bucket.
        dynamicMoneynessBucketType - dynamic moneyness bucket type
        tenorAndMaturityDefaultValue - default value for tenors and maturities
        asOfDateLevel - The asOfDate level.
        sensitivityNameLvl - sensitivity name level
        Returns:
        The fluent API calls required to build the measure.
      • init

        public void init​(Properties properties)
                  throws com.quartetfs.fwk.QuartetException
        Specified by:
        init in interface com.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>
        Overrides:
        init in class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor<Double>
        Throws:
        com.quartetfs.fwk.QuartetException
      • getContextDependencies

        public Set<Class<? extends com.quartetfs.biz.pivot.context.IContextValue>> getContextDependencies()
        Specified by:
        getContextDependencies in interface com.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>
        Overrides:
        getContextDependencies in class com.quartetfs.biz.pivot.postprocessing.impl.AAdvancedPostProcessor<Double>
      • compute

        public void compute​(com.quartetfs.biz.pivot.ILocation location,
                            com.quartetfs.biz.pivot.query.aggregates.IAdvancedAggregatesRetriever retriever)
        Specified by:
        compute in interface com.quartetfs.biz.pivot.postprocessing.IPostProcessor<Double>
      • createProcedure

        protected com.quartetfs.biz.pivot.cellset.IPointProcedure createProcedure​(com.quartetfs.biz.pivot.cellset.IAggregatesRetrievalResult result,
                                                                                  com.quartetfs.biz.pivot.query.aggregates.IAdvancedAggregatesRetriever retriever,
                                                                                  String[] dynamicSet,
                                                                                  MaturityPillarsDTO noBuckets,
                                                                                  com.quartetfs.biz.pivot.ILocation location)
        Create the point procedure that will be executed on the evaluation retrieval result.
        Parameters:
        result - The result to read aggregates from
        retriever - The aggregates retriever
        dynamicSet - dynamic set
        noBuckets - no buckets
        location - The location
        Returns:
        The procedure to execute on the evaluation cell set
      • evaluate

        public Double evaluate​(com.quartetfs.biz.pivot.ILocation location,
                               Object[] underlyingMeasures)
        This method is called to evaluate the post processor value on a given location The underlying measures are provided for the shifted location.

        When an evaluator is available, the evaluator is called on the location and measures, when no evaluator is available, the first underlying measure is returned, or null when no measure is available.

        Sub-classes can completely override this business logic and implement their own calculation.

        Parameters:
        location - This location is a point location (non range, without wild cards)
        underlyingMeasures - The values of the defined underlying measures
        Returns:
        The post processor value
      • defineDynamicBucketPath

        public com.quartetfs.biz.pivot.ILocation defineDynamicBucketPath​(com.quartetfs.biz.pivot.ILocation location,
                                                                         Object[] buckets,
                                                                         com.quartetfs.biz.pivot.ILocation inputLocation)
        Modifies the current location to reach the destination buckets.
        Parameters:
        location - The current location.
        buckets - The tenor and maturity destination buckets.
        inputLocation - The original requested location, used to modify location according to the requested one
        Returns:
        The modified location (specific buckets on the dynamic tenor and dynamic maturity hierarchies; AllMember on source tenor and source maturity hierarchies).
      • createPrefetchedLocation

        public com.quartetfs.biz.pivot.ILocation createPrefetchedLocation​(com.quartetfs.biz.pivot.ILocation location)
        Modifies the current location to be able to retrieve the source contributions.
        Parameters:
        location - The current location.
        Returns:
        The modified location (AllMember on the dynamic tenor and dynamic maturity hierarchies; wildcard on source tenor and source maturity hierarchies).
      • getType

        public String getType()
        Specified by:
        getType in interface com.quartetfs.fwk.types.IExtendedPluginValue
      • isValidMember

        protected boolean isValidMember​(Object analysisExplicitMembers,
                                        Object analysisMember)