public interface PointSensitivityBuilder
The sensitivity to a single point on a curve is known as point sensitivity. This builder allows the individual sensitivities to be built into a combined result.
Implementations may be mutable, however the methods are intended to be used in an immutable style. Once a method is called, code should refer and use only the result, not the original instance.
| Modifier and Type | Method and Description |
|---|---|
default PointSensitivities |
build()
Builds the resulting point sensitivity.
|
MutablePointSensitivities |
buildInto(MutablePointSensitivities combination)
Builds the point sensitivity, adding to the specified mutable instance.
|
PointSensitivityBuilder |
cloned()
Clones the point sensitivity builder.
|
default PointSensitivityBuilder |
combinedWith(PointSensitivityBuilder other)
Combines this sensitivity with another instance.
|
PointSensitivityBuilder |
mapSensitivity(DoubleUnaryOperator operator)
Returns an instance with the specified operation applied to the sensitivities in this builder.
|
default PointSensitivityBuilder |
multipliedBy(double factor)
Multiplies the sensitivities in this builder by the specified factor.
|
static PointSensitivityBuilder |
none()
Returns a builder representing no sensitivity.
|
PointSensitivityBuilder |
normalize()
Normalizes the point sensitivities by sorting and merging.
|
static PointSensitivityBuilder |
of(List<? extends PointSensitivity> sensitivities)
Returns a builder with the specified sensitivities.
|
static PointSensitivityBuilder |
of(PointSensitivity... sensitivities)
Returns a builder with the specified sensitivities.
|
PointSensitivityBuilder |
withCurrency(Currency currency)
Returns an instance with the specified currency applied to the sensitivities in this builder.
|
static PointSensitivityBuilder none()
This would be used if the rate was fixed, or if the rate was obtained from a historic time-series rather than a forward curve.
static PointSensitivityBuilder of(PointSensitivity... sensitivities)
sensitivities - the list of sensitivities, which is copiedstatic PointSensitivityBuilder of(List<? extends PointSensitivity> sensitivities)
sensitivities - the list of sensitivities, which is copiedPointSensitivityBuilder withCurrency(Currency currency)
The result will consists of the same points, but with the sensitivity currency assigned.
Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.
currency - the currency to be applied to the sensitivitiesdefault PointSensitivityBuilder multipliedBy(double factor)
The result will consist of the same points, but with each sensitivity multiplied.
Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.
factor - the multiplicative factorPointSensitivityBuilder mapSensitivity(DoubleUnaryOperator operator)
The result will consist of the same points, but with the operator applied to each sensitivity.
This is used to apply a mathematical operation to the sensitivities. For example, the operator could multiply the sensitivities by a constant, or take the inverse.
inverse = base.mapSensitivities(value -> 1 / value);
Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.
operator - the operator to be applied to the sensitivitiesPointSensitivityBuilder normalize()
The sensitivities in the builder are sorted and then merged. Any two entries that represent the same curve query are merged. For example, if there are two point sensitivities that were created based on the same curve, currency and fixing date, then the entries are combined, summing the sensitivity value.
Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.
default PointSensitivityBuilder combinedWith(PointSensitivityBuilder other)
This returns an instance with a combined list of point sensitivities.
Builders may be mutable. Once this method is called, this instance must not be used. Instead, the result of the method must be used.
other - the other sensitivity builderMutablePointSensitivities buildInto(MutablePointSensitivities combination)
combination - the combination object to add todefault PointSensitivities build()
This returns a PointSensitivities instance.
Builders may be mutable. Once this method is called, this instance must not be used.
PointSensitivityBuilder cloned()
This returns a PointSensitivityBuilder instance that is independent
from the original. Immutable implementations may return themselves.
Builders may be mutable. Using this method allows a copy of the original to be obtained, so both the original and the clone can be used.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.