Package org.threeten.bp

Examples of org.threeten.bp.LocalDate.plusMonths()


    payments = new TreeMap<>(PAYER_SWAP_WITH_SPREAD.accept(VISITOR));
    assertEquals(60, payments.size());
    paymentDate = SWAP_START.plusMonths(6).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(6);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 2. + SWAP_NOTIONAL * IBOR_SPREAD / 2., ca.getAmount());
View Full Code Here


    Map<LocalDate, MultipleCurrencyAmount> payments = new TreeMap<>(RECEIVE_SPREAD_IBOR_IBOR_SWAP.accept(VISITOR));
    assertEquals(100, payments.size());
    LocalDate paymentDate = SWAP_START.plusMonths(6).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(6);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 2. + SWAP_NOTIONAL * IBOR_SPREAD / 2., ca.getAmount());
View Full Code Here

    payments = new TreeMap<>(PAY_SPREAD_IBOR_IBOR_SWAP.accept(VISITOR));
    assertEquals(200, payments.size());
    paymentDate = SWAP_START.plusMonths(3).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(3);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 4., ca.getAmount());
View Full Code Here

    Map<LocalDate, MultipleCurrencyAmount> payments = new TreeMap<>(RECEIVER_SWAP.accept(VISITOR));
    assertEquals(60, payments.size());
    LocalDate paymentDate = SWAP_START.plusMonths(6).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(6);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL * 0.5, ca.getAmount());
View Full Code Here

    payments = new TreeMap<>(RECEIVER_SWAP_WITH_SPREAD.accept(VISITOR));
    assertEquals(60, payments.size());
    paymentDate = SWAP_START.plusMonths(6).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(6);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 2. + SWAP_NOTIONAL * IBOR_SPREAD / 2., ca.getAmount());
View Full Code Here

    Map<LocalDate, MultipleCurrencyAmount> payments = new TreeMap<>(PAY_SPREAD_IBOR_IBOR_SWAP.accept(VISITOR));
    assertEquals(100, payments.size());
    LocalDate paymentDate = SWAP_START.plusMonths(6).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(6);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 2. + SWAP_NOTIONAL * IBOR_SPREAD / 2., ca.getAmount());
View Full Code Here

    payments = new TreeMap<>(RECEIVE_SPREAD_IBOR_IBOR_SWAP.accept(VISITOR));
    assertEquals(200, payments.size());
    paymentDate = SWAP_START.plusMonths(3).toLocalDate();
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      paymentDate = paymentDate.plusMonths(3);
      final MultipleCurrencyAmount mca = entry.getValue();
      assertEquals(1, mca.size());
      final CurrencyAmount ca = Iterables.getOnlyElement(mca);
      assertEquals(FIXED_INCOME_CURRENCY, ca.getCurrency());
      assertEquals(SWAP_NOTIONAL / 4., ca.getAmount());
View Full Code Here

    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      assertEquals(1, entry.getValue().size());
      assertEquals(FIXED_INCOME_CURRENCY, entry.getValue().getCurrencyAmounts()[0].getCurrency());
      assertEquals(SWAP_NOTIONAL * FIXING_RATE / 2, entry.getValue().getCurrencyAmounts()[0].getAmount(), 1e-15);
      paymentDate = paymentDate.plusMonths(6);
    }
    payments = new TreeMap<>(PAYER_SWAP_WITH_SPREAD.accept(VISITOR, IBOR_FIXING_SERIES));
    assertEquals(24, payments.size());
    paymentDate = SWAP_START.toLocalDate().plusMonths(6);
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
View Full Code Here

    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      assertEquals(1, entry.getValue().size());
      assertEquals(FIXED_INCOME_CURRENCY, entry.getValue().getCurrencyAmounts()[0].getCurrency());
      assertEquals(SWAP_NOTIONAL * (FIXING_RATE + IBOR_SPREAD) / 2, entry.getValue().getCurrencyAmounts()[0].getAmount(), 1e-15);
      paymentDate = paymentDate.plusMonths(6);
    }
  }

  @Test
  public void testReceiverSwap() {
View Full Code Here

    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
      assertEquals(paymentDate, entry.getKey());
      assertEquals(1, entry.getValue().size());
      assertEquals(FIXED_INCOME_CURRENCY, entry.getValue().getCurrencyAmounts()[0].getCurrency());
      assertEquals(SWAP_NOTIONAL * SWAP_FIXED_RATE / 2, entry.getValue().getCurrencyAmounts()[0].getAmount(), 1e-15);
      paymentDate = paymentDate.plusMonths(6);
    }
    payments = new TreeMap<>(RECEIVER_SWAP_WITH_SPREAD.accept(VISITOR));
    assertEquals(60, payments.size());
    paymentDate = SWAP_START.toLocalDate().plusMonths(6);
    for (final Map.Entry<LocalDate, MultipleCurrencyAmount> entry : payments.entrySet()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.