|Modifier and Type||Method and Description|
Add a new pair of currencies to the builder.
Adds a new rate for a currency pair to the builder.
Adds a collection of new rates for currency pairs to the builder.
Build a new
public FxMatrix build()
FxMatrixfrom the data in the builder.
IllegalStateException- if an attempt was made to add currencies which have no currency in common with other rates
public FxMatrixBuilder addRate(CurrencyPair currencyPair, double rate)
addRate(Currency, Currency, double)for full explanation.
currencyPair- the currency pair to be added
rate- the FX rate between the base currency of the pair and the counter currency. The rate indicates the value of one unit of the base currency in terms of the counter currency.
public FxMatrixBuilder addRate(Currency ccy1, Currency ccy2, double rate)
An invocation of the method with
builder.addRate(GBP, USD, 1.6)
indicates that 1 pound sterling is worth 1.6 US dollars. It is
builder.addRate(USD, GBP, 1 / 1.6) (1 US dollar
is worth 0.625 pounds sterling) for all cases except where the USD/GBP
rates is already in the matrix and so will be updated.
Note that due to one of the rates being treated as a reference, this
operation is not symmetric. That is, the result of
matrix.addRate(USD, EUR, 1.23) will be different to the
matrix.addRate(EUR, USD, 1 / 1.23) when there
are other currencies present in the builder.
ccy1- the first currency of the pair
ccy2- the second currency of the pair
rate- the FX rate between the first currency and the second currency. The rate indicates the value of one unit of the first currency in terms of the second currency.
public FxMatrixBuilder addRates(Map<CurrencyPair,Double> rates)
rates- the currency pairs and rates to be added
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.