Examples of plusYears()


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

        numberOfLeapDays++;
      } else if (previousDate.isLeapYear() && previousDate.isBefore(getLeapDateOfYear(previousDate.getYear()))) {
        numberOfLeapDays++;
      }
      previousDate = date;
      date = date.plusYears(1);
    }
    return (secondJulianDate - firstJulianDate - numberOfLeapDays) / 365.;
  }

  @Override
View Full Code Here

Examples of org.threeten.bp.LocalDate.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");
    }
    LocalDate date = startDate.with(_monthDay);
    if (date.isBefore(startDate)) {
      date = date.plusYears(1);
    }
    final List<LocalDate> dates = new ArrayList<>();
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
View Full Code Here

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

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

  @Override
View Full Code Here

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

      throw new IllegalArgumentException("Start date and end date were the same but neither was the first day of the year");
    }
    final List<LocalDate> dates = new ArrayList<>();
    LocalDate 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.LocalDate.plusYears()

    if (date.isBefore(startDate)) {
      date = date.plusYears(1);
    }
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1);
    }
    return dates.toArray(EMPTY_LOCAL_DATE_ARRAY);
  }

  @Override
View Full Code Here

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

    }
    final List<LocalDate> dates = new ArrayList<>();
    LocalDate date = startDate.with(TemporalAdjusters.lastDayOfYear());
    while (!date.isAfter(endDate)) {
      dates.add(date);
      date = date.plusYears(1).with(TemporalAdjusters.lastDayOfYear());
    }
    return dates.toArray(EMPTY_LOCAL_DATE_ARRAY);
  }

  @Override
View Full Code Here

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

    }

    @Test
    public void test_plusYear_zero_equals() {
        Year base = Year.of(2007);
        assertEquals(base.plusYears(0), base);
    }

    @Test
    public void test_plusYears_big() {
        long years = 20L + Year.MAX_VALUE;
View Full Code Here

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

    // plusYears()
    //-----------------------------------------------------------------------
    @Test
    public void test_plusYears_long() {
        YearMonth test = YearMonth.of(2008, 6);
        assertEquals(test.plusYears(1), YearMonth.of(2009, 6));
    }

    @Test
    public void test_plusYears_long_noChange_equal() {
        YearMonth test = YearMonth.of(2008, 6);
View Full Code Here

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

    }

    @Test
    public void test_plusYears_long_noChange_equal() {
        YearMonth test = YearMonth.of(2008, 6);
        assertEquals(test.plusYears(0), test);
    }

    @Test
    public void test_plusYears_long_negative() {
        YearMonth test = YearMonth.of(2008, 6);
View Full Code Here

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

    }

    @Test
    public void test_plusYears_long_negative() {
        YearMonth test = YearMonth.of(2008, 6);
        assertEquals(test.plusYears(-1), YearMonth.of(2007, 6));
    }

    @Test
    public void test_plusYears_long_big() {
        YearMonth test = YearMonth.of(-40, 6);
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.