| Modifier and Type | Method and Description |
|---|---|
FxMatrixBuilder |
addRate(Currency ccy1,
Currency ccy2,
double rate)
Add a new pair of currencies to the builder.
|
FxMatrixBuilder |
addRate(CurrencyPair currencyPair,
double rate)
Adds a new rate for a currency pair to the builder.
|
FxMatrixBuilder |
addRates(Map<CurrencyPair,Double> rates)
Adds a collection of new rates for currency pairs to the builder.
|
FxMatrix |
build()
Build a new
FxMatrix from the data in the builder. |
public FxMatrix build()
FxMatrix from the data in the builder.FxMatrixIllegalStateException - if an attempt was made to add currencies
which have no currency in common with other ratespublic FxMatrixBuilder addRate(CurrencyPair currencyPair, double rate)
addRate(Currency, Currency, double) for full
explanation.currencyPair - the currency pair to be addedrate - 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
equivalent to: 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.
build() is called.
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
result of matrix.addRate(EUR, USD, 1 / 1.23) when there
are other currencies present in the builder.
ccy1 - the first currency of the pairccy2 - the second currency of the pairrate - 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 addedCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.