Examples of plusYears()


Examples of org.threeten.bp.YearMonth.plusYears()

    }

    @Test
    public void test_plusYears_long_big() {
        YearMonth test = YearMonth.of(-40, 6);
        assertEquals(test.plusYears(20L + Year.MAX_VALUE), YearMonth.of((int) (-40L + 20L + Year.MAX_VALUE), 6));
    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLarge() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 6);
View Full Code Here

Examples of org.threeten.bp.YearMonth.plusYears()

    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLarge() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 6);
        test.plusYears(1);
    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLargeMaxAddMax() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
View Full Code Here

Examples of org.threeten.bp.YearMonth.plusYears()

    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLargeMaxAddMax() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
        test.plusYears(Long.MAX_VALUE);
    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLargeMaxAddMin() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
View Full Code Here

Examples of org.threeten.bp.YearMonth.plusYears()

    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooLargeMaxAddMin() {
        YearMonth test = YearMonth.of(Year.MAX_VALUE, 12);
        test.plusYears(Long.MIN_VALUE);
    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooSmall() {
        YearMonth test = YearMonth.of(Year.MIN_VALUE, 6);
View Full Code Here

Examples of org.threeten.bp.YearMonth.plusYears()

    }

    @Test(expectedExceptions=DateTimeException.class)
    public void test_plusYears_long_invalidTooSmall() {
        YearMonth test = YearMonth.of(Year.MIN_VALUE, 6);
        test.plusYears(-1);
    }

    //-----------------------------------------------------------------------
    // plusMonths()
    //-----------------------------------------------------------------------
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.plusYears()

      }
      throw new IllegalArgumentException("Start date and end date were the same but the day of month and month of year were not those required");
    }
    ZonedDateTime date = startDate.with(_monthDay);
    if (date.isBefore(startDate)) {
      date = date.plusYears(1);
    }
    final List<ZonedDateTime> dates = new ArrayList<>();
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.plusYears()

      date = date.plusYears(1);
    }
    final List<ZonedDateTime> dates = new ArrayList<>();
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
    }
    return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
  }

  @Override
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.plusYears()

      throw new IllegalArgumentException("Start date and end date were the same but neither was the first day of the year");
    }
    final List<ZonedDateTime> dates = new ArrayList<>();
    ZonedDateTime date = startDate.with(TemporalAdjusters.firstDayOfYear());
    if (date.isBefore(startDate)) {
      date = date.plusYears(1);
    }
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
    }
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.plusYears()

    if (date.isBefore(startDate)) {
      date = date.plusYears(1);
    }
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
    }
    return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
  }
}
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.plusYears()

    }
    final List<ZonedDateTime> dates = new ArrayList<>();
    ZonedDateTime date = startDate.with(TemporalAdjusters.lastDayOfYear());
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1).with(TemporalAdjusters.lastDayOfYear());
    }
    return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
  }
}
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.