/** * Gets the currency of the Ibor index. * * @return the currency of the index */ public Currency getCurrency() { return index.getCurrency(); }
/** * Gets the currency of the leg from the index. * * @return the currency */ public Currency getCurrency() { return index.getCurrency(); }
@Override public void collectCurrencies(ImmutableSet.Builder<Currency> builder) { builder.add(index.getCurrency()); }
private Currency getCurrency(Index index) { if (index instanceof RateIndex) { return ((RateIndex) index).getCurrency(); } else if (index instanceof PriceIndex) { return ((PriceIndex) index).getCurrency(); } throw new IllegalArgumentException("unsupported index"); }
public void test_gb_rpi() { assertEquals(PriceIndices.GB_RPI.getCurrency(), GBP); assertEquals(PriceIndices.GB_RPI.getDayCount(), DayCounts.ONE_ONE); assertEquals(PriceIndices.GB_RPI.getDefaultFixedLegDayCount(), DayCounts.ONE_ONE); }
public void test_of_withoutCurrency() { InflationRateSensitivity test = InflationRateSensitivity.of(GB_HICP_OBS, 1.0); assertEquals(test.getIndex(), GB_HICP); assertEquals(test.getCurrency(), GB_HICP.getCurrency()); assertEquals(test.getObservation(), GB_HICP_OBS); assertEquals(test.getSensitivity(), 1.0); }
public void test_gbpHicp() { PriceIndex test = PriceIndex.of("GB-HICP"); assertEquals(test.getName(), "GB-HICP"); assertEquals(test.getCurrency(), GBP); assertEquals(test.getRegion(), GB); assertEquals(test.isActive(), true); assertEquals(test.getPublicationFrequency(), Frequency.P1M); assertEquals(test.getFloatingRateName(), FloatingRateName.of("GB-HICP")); assertEquals(test.toString(), "GB-HICP"); }
public void test_of() { PriceIndexObservation test = PriceIndexObservation.of(GB_HICP, FIXING_MONTH); assertEquals(test.getIndex(), GB_HICP); assertEquals(test.getFixingMonth(), FIXING_MONTH); assertEquals(test.getCurrency(), GB_HICP.getCurrency()); assertEquals(test.toString(), "PriceIndexObservation[GB-HICP on 2016-02]"); }