当前位置: 首页>>代码示例>>Java>>正文


Java Month.FEBRUARY属性代码示例

本文整理汇总了Java中org.threeten.bp.Month.FEBRUARY属性的典型用法代码示例。如果您正苦于以下问题:Java Month.FEBRUARY属性的具体用法?Java Month.FEBRUARY怎么用?Java Month.FEBRUARY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.threeten.bp.Month的用法示例。


在下文中一共展示了Month.FEBRUARY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDayCountFraction

@Override
public double getDayCountFraction(final LocalDate firstDate, final LocalDate secondDate) {
  testDates(firstDate, secondDate);
  final long daysBetween = firstDate.periodUntil(secondDate, DAYS);
  final LocalDate oneYear = firstDate.plusYears(1);
  if (secondDate.isBefore(oneYear) || oneYear.equals(secondDate)) {
    final double daysInYear = secondDate.isLeapYear() && secondDate.getMonthValue() > 2 ? 366 : 365;
    return daysBetween / daysInYear;
  }
  final LocalDate[] schedule = ScheduleFactory.getSchedule(firstDate, secondDate, 1, true, true, false);
  LocalDate d = schedule[0];
  if (d.isLeapYear() && d.getMonth() == Month.FEBRUARY && d.getDayOfMonth() == 28) {
    d = d.plusDays(1);
  }
  return schedule.length - 1.0 + getDayCountFraction(firstDate, d);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:16,代码来源:ActualActualAFB.java

示例2: testMissingMonth

@Test
public void testMissingMonth() {
  final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_MISSING_MONTH, DAILY_SCHEDULE);
  assertEquals(result.size(), DAILY_SCHEDULE.length);
  int i = 0;
  for (final Entry<LocalDate, Double> entry : result) {
    assertEquals(entry.getKey(), DAILY_SCHEDULE[i]);
    if (entry.getKey().getMonth() == Month.FEBRUARY && entry.getKey().getYear() == 2009) {
      assertEquals(entry.getValue(), 21, 0);
    } else {
      assertEquals(entry.getValue(), i, 0);
    }
    i++;
  }
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:15,代码来源:PreviousValuePaddingTimeSeriesSamplingFunctionTest.java

示例3: testBadDay

@Test(expectedExceptions = DateTimeException.class)
public void testBadDay() {
  new AnnualScheduleOnDayAndMonthCalculator(31, Month.FEBRUARY);
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:4,代码来源:AnnualScheduleOnDayAndMonthCalculatorTest.java


注:本文中的org.threeten.bp.Month.FEBRUARY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。