java.time.YearMonth.plus()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中java.time.YearMonth.plus()方法的一些代码示例,展示了YearMonth.plus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonth.plus()方法的具体详情如下:
包路径:java.time.YearMonth
类名称:YearMonth
方法名:plus

YearMonth.plus介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. private void goToDayCell(DateCell dateCell, int offset, ChronoUnit unit, boolean focusDayCell) {
  2. YearMonth yearMonth = selectedYearMonth.get().plus(offset, unit);
  3. goToDate(dayCellDate(dateCell).plus(offset, unit).withYear(yearMonth.getYear()), focusDayCell);
  4. }

代码示例来源:origin: com.github.seratch/java-time-backport

  1. /**
  2. * {@inheritDoc}
  3. * @throws DateTimeException {@inheritDoc}
  4. * @throws ArithmeticException {@inheritDoc}
  5. */
  6. @Override
  7. public YearMonth minus(long amountToSubtract, TemporalUnit unit) {
  8. return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE, unit).plus(1, unit) : plus(-amountToSubtract, unit));
  9. }

代码示例来源:origin: owlike/genson

  1. private static YearMonth fromEpochMonth(long months){
  2. return EPOCH_YEAR_MONTH.plus(months, ChronoUnit.MONTHS);
  3. }
  4. }

代码示例来源:origin: OpenGamma/Strata

  1. public void coverage() {
  2. InflationNodalCurveDefinition test = new InflationNodalCurveDefinition(
  3. UNDERLYING_DEF, LAST_FIX_MONTH, LAST_FIX_VALUE, SEASONALITY_DEF);
  4. coverImmutableBean(test);
  5. InterpolatedNodalCurveDefinition underlyingDef2 = InterpolatedNodalCurveDefinition.builder()
  6. .name(CurveName.of("foo"))
  7. .xValueType(ValueType.YEAR_FRACTION)
  8. .yValueType(ValueType.ZERO_RATE)
  9. .dayCount(ACT_365F)
  10. .nodes(NODES)
  11. .interpolator(CurveInterpolators.LINEAR)
  12. .extrapolatorLeft(CurveExtrapolators.FLAT)
  13. .extrapolatorRight(CurveExtrapolators.FLAT)
  14. .build();
  15. SeasonalityDefinition seasonalityDef2 =
  16. SeasonalityDefinition.of(SEASONALITY_ADDITIVE, ShiftType.SCALED);
  17. InflationNodalCurveDefinition test2 = new InflationNodalCurveDefinition(
  18. underlyingDef2, LAST_FIX_MONTH.plus(Period.ofMonths(1)), LAST_FIX_VALUE + 1.0d, seasonalityDef2);
  19. coverBeanEquals(test, test2);
  20. }

相关文章