## Interface PointSensitivity

• All Superinterfaces:
FxConvertible<PointSensitivity>
All Known Implementing Classes:
BondFutureOptionSensitivity, CreditCurveZeroRateSensitivity, FxForwardSensitivity, FxIndexSensitivity, FxOptionSensitivity, IborCapletFloorletSabrSensitivity, IborCapletFloorletSensitivity, IborFutureOptionSensitivity, IborRateSensitivity, InflationRateSensitivity, IssuerCurveZeroRateSensitivity, OvernightRateSensitivity, RepoCurveZeroRateSensitivity, SwaptionSabrSensitivity, SwaptionSensitivity, ZeroRateSensitivity

public interface PointSensitivity
extends FxConvertible<PointSensitivity>
Point sensitivity.

The sensitivity to a single point on a curve, surface or similar. This is used within PointSensitivities.

Each implementation of this interface will consist of two distinct parts. The first is a set of information that identifies the point. The second is the sensitivity value.

For example, when an Ibor index is queried, the implementation would typically contain the Ibor index, fixing date and the sensitivity value.

Implementations must be immutable and thread-safe beans.

• ### Method Summary

All Methods
Modifier and Type Method Description
int compareKey​(PointSensitivity other)
Compares the key of two sensitivities, excluding the point sensitivity value.
default PointSensitivity convertedTo​(Currency resultCurrency, FxRateProvider rateProvider)
Converts this instance to an equivalent amount in the specified currency.
Currency getCurrency()
Gets the currency of the point sensitivity.
double getSensitivity()
Gets the point sensitivity value.
PointSensitivity withCurrency​(Currency currency)
Returns an instance with the specified sensitivity currency set.
PointSensitivity withSensitivity​(double sensitivity)
Returns an instance with the new point sensitivity value.
• ### 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:
java.lang.RuntimeException - if no FX rate could be found