public interface ParameterizedData
double parameters.
This interface provides an abstraction over many different kinds of market data, including curves, surfaces and cubes. This abstraction allows an API to be structured in such a way that it does not directly expose the underlying data. For example, swaption volatilities might be based on a surface or a cube.
Implementations must be immutable and thread-safe.
| Modifier and Type | Method and Description |
|---|---|
default OptionalInt |
findParameterIndex(ParameterMetadata metadata)
Finds the parameter index of the specified metadata.
|
double |
getParameter(int parameterIndex)
Gets the value of the parameter at the specified index.
|
int |
getParameterCount()
Gets the number of parameters.
|
ParameterMetadata |
getParameterMetadata(int parameterIndex)
Gets the metadata of the parameter at the specified index.
|
ParameterizedData |
withParameter(int parameterIndex,
double newValue)
Returns a copy of the data with the value at the specified index altered.
|
default ParameterizedData |
withPerturbation(ParameterPerturbation perturbation)
Returns a perturbed copy of the data.
|
int getParameterCount()
This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
double getParameter(int parameterIndex)
parameterIndex - the zero-based index of the parameter to getIndexOutOfBoundsException - if the index is invalidParameterMetadata getParameterMetadata(int parameterIndex)
If there is no specific parameter metadata, an empty instance will be returned.
parameterIndex - the zero-based index of the parameter to getIndexOutOfBoundsException - if the index is invaliddefault OptionalInt findParameterIndex(ParameterMetadata metadata)
If the parameter metadata is not matched, an empty optional will be returned.
metadata - the parameter metadata to find the index ofParameterizedData withParameter(int parameterIndex, double newValue)
This instance is immutable and unaffected by this method call.
parameterIndex - the zero-based index of the parameter to getnewValue - the new value for the specified parameterIndexOutOfBoundsException - if the index is invaliddefault ParameterizedData withPerturbation(ParameterPerturbation perturbation)
The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
perturbation - the perturbation to applyCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.