Package com.opengamma.strata.market
Class FxRateShifts
- java.lang.Object
-
- com.opengamma.strata.market.FxRateShifts
-
- All Implemented Interfaces:
ScenarioPerturbation<FxRate>,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class FxRateShifts extends Object implements ScenarioPerturbation<FxRate>, org.joda.beans.ImmutableBean, Serializable
A perturbation that applies different shifts to an FX rate.This class contains shifts, each of which is associated with a scenario and applied to an FX rate based on the shift type.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFxRateShifts.MetaThe meta-bean forFxRateShifts.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MarketDataBox<FxRate>applyTo(MarketDataBox<FxRate> marketData, ReferenceData refData)Applies this perturbation to the market data in a box, returning a box containing new, modified data.booleanequals(Object obj)CurrencyPairgetCurrencyPair()Gets the currency pair for which the shifts are applied.Class<FxRate>getMarketDataType()Returns the market data type that the perturbation changes.intgetScenarioCount()Returns the number of scenarios for which this perturbation generates data.DoubleArraygetShiftAmount()Gets the shifts to apply toFxRate.ShiftTypegetShiftType()Gets the type of shift applied to the FX rate.inthashCode()static FxRateShifts.Metameta()The meta-bean forFxRateShifts.FxRateShifts.MetametaBean()static FxRateShiftsof(ShiftType shiftType, DoubleArray shiftAmount, CurrencyPair currencyPair)Creates an instance.StringtoString()
-
-
-
Method Detail
-
of
public static FxRateShifts of(ShiftType shiftType, DoubleArray shiftAmount, CurrencyPair currencyPair)
Creates an instance.- Parameters:
shiftType- the shift typeshiftAmount- the shift amountcurrencyPair- the currency pair- Returns:
- the instance
-
applyTo
public MarketDataBox<FxRate> applyTo(MarketDataBox<FxRate> marketData, ReferenceData refData)
Description copied from interface:ScenarioPerturbationApplies this perturbation to the market data in a box, returning a box containing new, modified data.The original market data must not be altered. Instead a perturbed copy must be returned.
- Specified by:
applyToin interfaceScenarioPerturbation<FxRate>- Parameters:
marketData- the market data to perturbrefData- the reference data- Returns:
- new market data derived by applying the perturbation to the input data
-
getScenarioCount
public int getScenarioCount()
Description copied from interface:ScenarioPerturbationReturns the number of scenarios for which this perturbation generates data.- Specified by:
getScenarioCountin interfaceScenarioPerturbation<FxRate>- Returns:
- the number of scenarios for which this perturbation generates data
-
getMarketDataType
public Class<FxRate> getMarketDataType()
Description copied from interface:ScenarioPerturbationReturns the market data type that the perturbation changes.- Specified by:
getMarketDataTypein interfaceScenarioPerturbation<FxRate>- Returns:
- the data type
-
meta
public static FxRateShifts.Meta meta()
The meta-bean forFxRateShifts.- Returns:
- the meta-bean, not null
-
metaBean
public FxRateShifts.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getShiftType
public ShiftType getShiftType()
Gets the type of shift applied to the FX rate.- Returns:
- the value of the property, not null
-
getShiftAmount
public DoubleArray getShiftAmount()
Gets the shifts to apply toFxRate.Each element in the array corresponds to each scenario.
- Returns:
- the value of the property, not null
-
getCurrencyPair
public CurrencyPair getCurrencyPair()
Gets the currency pair for which the shifts are applied.This also defines the direction of the FX rate to be shifted.
- Returns:
- the value of the property, not null
-
-