Class StoreQueryMaturityConverter

  • All Implemented Interfaces:
    IMaturityConverter

    public class StoreQueryMaturityConverter
    extends Object
    implements IMaturityConverter
    Implementation of a maturity converter that queries a store for the number of days represented by a tenor. (does not include support for support business day convention or calendar).
    • Method Detail

      • getQueryCache

        protected com.quartetfs.biz.pivot.query.IQueryCache getQueryCache​(com.quartetfs.biz.pivot.IActivePivot pivot)
        Return the query cache bound to the current query. This cache contains values that can be shared among post processors involved in a query. The values in this cache are never shared with other queries.

        The query cache itself is thread-safe, actually implementing the concurrent map interface.

        Parameters:
        pivot - ActivePivot instance
        Returns:
        current query cache, it is never null
      • toFraction

        public double toFraction​(com.quartetfs.biz.pivot.IActivePivot pivot,
                                 LocalDate asOfDate,
                                 BucketType bucketType,
                                 String tenorSet,
                                 String tenorOrDate,
                                 List<Object> leafCoordinates)
        Calculate the days between the asOfDate and the tenorOrDate. Extra parameters are required for query-time conversion.
        Specified by:
        toFraction in interface IMaturityConverter
        Parameters:
        pivot - The ActivePivot instance.
        asOfDate - The initial as-of-date.
        tenorSet - The tenor set.
        tenorOrDate - The String representation of a tenor or number of days.
        leafCoordinates - Leaf coordinates required for query-time conversion.
        bucketType - The tenor store.
        Returns:
        a long representing a number of days
      • toDate

        public LocalDate toDate​(com.quartetfs.biz.pivot.IActivePivot pivot,
                                LocalDate asOfDate,
                                BucketType bucketType,
                                String tenorSet,
                                String tenorOrDate,
                                List<Object> leafCoordinates)
        Convert tenorOrDate to a LocalDate. Extra parameters are required for query-time conversion. The toFraction method is used to compute the number of days between tenorOrDate and asOfDate. That method returns a double value that is floored so that it represents a long value and not a double.
        Specified by:
        toDate in interface IMaturityConverter
        Parameters:
        pivot - The ActivePivot instance.
        asOfDate - The initial as-of-date, for use with tenors.
        tenorSet - The tenor set.
        tenorOrDate - The String representation of a tenor or date.
        leafCoordinates - Leaf coordinates required for query-time conversion.
        bucketType - The tenor store.
        Returns:
        The LocalDate represented by tenorOrDate.