Interface PointSensitivity

    • Method Detail

      • getCurrency

        Currency getCurrency()
        Gets the currency of the point sensitivity.
        Returns:
        the currency
      • getSensitivity

        double getSensitivity()
        Gets the point sensitivity value.
        Returns:
        the sensitivity
      • withCurrency

        PointSensitivity withCurrency​(Currency currency)
        Returns an instance with the specified sensitivity currency set.

        The result will consists of the same points, but with the sensitivity currency altered.

        Parameters:
        currency - the new currency
        Returns:
        an instance based on this sensitivity with the specified currency
      • withSensitivity

        PointSensitivity withSensitivity​(double sensitivity)
        Returns an instance with the new point sensitivity value.
        Parameters:
        sensitivity - the new sensitivity
        Returns:
        an instance based on this sensitivity with the specified sensitivity
      • compareKey

        int compareKey​(PointSensitivity other)
        Compares the key of two sensitivities, excluding the point sensitivity value.

        If the other point sensitivity is of a different type, the comparison is based solely on the simple class name. If the point sensitivity is of the same type, the comparison must check the key, then the currency, then the date, then any other state.

        The comparison by simple class name ensures that all instances of the same type are ordered together.

        Parameters:
        other - the other sensitivity
        Returns:
        positive if greater, zero if equal, negative if less
      • convertedTo

        default PointSensitivity convertedTo​(Currency resultCurrency,
                                             FxRateProvider rateProvider)
        Converts this instance to an equivalent amount in the specified currency.

        The result will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.

        Specified by:
        convertedTo in interface FxConvertible<PointSensitivity>
        Parameters:
        resultCurrency - the currency of the result
        rateProvider - the provider of FX rates
        Returns:
        the converted instance, which should be expressed in the specified currency
        Throws:
        RuntimeException - if no FX rate could be found