Class CurveSensitivities

    • Method Detail

      • empty

        public static CurveSensitivities empty()
        Obtains an empty instance.
        Returns:
        the empty sensitivities instance
      • builder

        public static CurveSensitivitiesBuilder builder​(PortfolioItemInfo info)
        Returns a builder that can be used to create an instance of CurveSensitivities.

        The builder takes into account the parameter metadata when creating the sensitivity map. As such, the parameter metadata added to the builder must not be empty.

        Parameters:
        info - the additional information
        Returns:
        the builder
      • mergedWith

        public CurveSensitivities mergedWith​(CurveSensitivities other)
        Combines this set of sensitivities with another set.

        This returns a new curve sensitivities with a combined map of typed sensitivities. Any sensitivities of the same type will be combined as though using CurrencyParameterSensitivities.mergedWith(CurrencyParameterSensitivities). The identifier and attributes of this instance will take precedence.

        Parameters:
        other - the other parameter sensitivities
        Returns:
        an instance based on this one, with the other instance added
      • withMarketDataNames

        public CurveSensitivities withMarketDataNames​(Function<MarketDataName<?>,​MarketDataName<?>> nameFn)
        Checks and adjusts the market data names.

        The supplied function is invoked for each market data name in this sensitivities. A typical use case would be to convert index names to curve names valid for an underlying system.

        Parameters:
        nameFn - the function for checking and adjusting the name
        Returns:
        the adjusted sensitivity
        Throws:
        RuntimeException - if the function throws an exception
      • withParameterMetadatas

        public CurveSensitivities withParameterMetadatas​(UnaryOperator<ParameterMetadata> mdFn)
        Checks and adjusts the parameter metadata.

        The supplied function is invoked for each parameter metadata in this sensitivities. If the function returns the same metadata for two different inputs, the sensitivity value will be summed. A typical use case would be to normalize parameter metadata tenors to be valid for an underlying system.

        Parameters:
        mdFn - the function for checking and adjusting the metadata
        Returns:
        the adjusted sensitivity
        Throws:
        RuntimeException - if the function throws an exception
      • convertedTo

        public CurveSensitivities convertedTo​(Currency resultCurrency,
                                              FxRateProvider rateProvider)
        Converts the sensitivities in this instance to an equivalent in the specified currency.

        Any FX conversion that is required will use rates from the provider.

        Specified by:
        convertedTo in interface FxConvertible<CurveSensitivities>
        Parameters:
        resultCurrency - the currency of the result
        rateProvider - the provider of FX rates
        Returns:
        the sensitivity object expressed in terms of the result currency
        Throws:
        RuntimeException - if no FX rate could be found
      • summarize

        public PortfolioItemSummary summarize()
        Description copied from interface: PortfolioItem
        Summarizes the portfolio item.

        This provides a summary, including a human readable description.

        Specified by:
        summarize in interface PortfolioItem
        Returns:
        the summary of the item
      • meta

        public static CurveSensitivities.Meta meta()
        The meta-bean for CurveSensitivities.
        Returns:
        the meta-bean, not null
      • getInfo

        public PortfolioItemInfo getInfo()
        Gets the additional information.

        This allows additional information to be attached to the sensitivities.

        Specified by:
        getInfo in interface PortfolioItem
        Specified by:
        getInfo in interface Sensitivities
        Returns:
        the value of the property, not null
      • getTypedSensitivities

        public ImmutableMap<CurveSensitivitiesType,​CurrencyParameterSensitivities> getTypedSensitivities()
        Gets the sensitivities, keyed by type.

        The map allows sensitivity to different types to be expressed. For example, there might be both delta and gamma sensitivity.

        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object