public final class GenericDoubleShifts extends Object implements ScenarioPerturbation<Double>, org.joda.beans.ImmutableBean, Serializable
This class contains shifts, each of which is associated with a scenario and applied to a value based on the shift type. A constant spread can be added for all of the scenarios.
A typical application of this is to generate scenario perturbation to market quotes,
where the market quote is represented in terms of QuoteId and Double.
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericDoubleShifts.Meta
The meta-bean for
GenericDoubleShifts. |
| Modifier and Type | Method and Description |
|---|---|
MarketDataBox<Double> |
applyTo(MarketDataBox<Double> marketData,
ReferenceData refData) |
boolean |
equals(Object obj) |
Class<Double> |
getMarketDataType() |
int |
getScenarioCount() |
DoubleArray |
getShiftAmount()
Gets the shifts to apply to a
Double value. |
ShiftType |
getShiftType()
Gets the type of shift applied to a
Double value. |
double |
getSpread()
Gets the constant spread.
|
int |
hashCode() |
static GenericDoubleShifts.Meta |
meta()
The meta-bean for
GenericDoubleShifts. |
GenericDoubleShifts.Meta |
metaBean() |
static GenericDoubleShifts |
of(ShiftType shiftType,
DoubleArray shiftAmount)
Creates an instance with zero spread.
|
static GenericDoubleShifts |
of(ShiftType shiftType,
DoubleArray shiftAmount,
double spread)
Creates an instance with spread.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitnonepublic static GenericDoubleShifts of(ShiftType shiftType, DoubleArray shiftAmount)
shiftType - the shift typeshiftAmount - the shift amountpublic static GenericDoubleShifts of(ShiftType shiftType, DoubleArray shiftAmount, double spread)
shiftType - the shift typeshiftAmount - the shift amountspread - the spreadpublic MarketDataBox<Double> applyTo(MarketDataBox<Double> marketData, ReferenceData refData)
applyTo in interface ScenarioPerturbation<Double>public int getScenarioCount()
getScenarioCount in interface ScenarioPerturbation<Double>public Class<Double> getMarketDataType()
getMarketDataType in interface ScenarioPerturbation<Double>public static GenericDoubleShifts.Meta meta()
GenericDoubleShifts.public GenericDoubleShifts.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ShiftType getShiftType()
Double value.public DoubleArray getShiftAmount()
Double value.
Each element in the array corresponds to each scenario.
public double getSpread()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.