本文整理了Java中java.time.YearMonth.plus()
方法的一些代码示例,展示了YearMonth.plus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMonth.plus()
方法的具体详情如下:
包路径:java.time.YearMonth
类名称:YearMonth
方法名:plus
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
private void goToDayCell(DateCell dateCell, int offset, ChronoUnit unit, boolean focusDayCell) {
YearMonth yearMonth = selectedYearMonth.get().plus(offset, unit);
goToDate(dayCellDate(dateCell).plus(offset, unit).withYear(yearMonth.getYear()), focusDayCell);
}
代码示例来源:origin: com.github.seratch/java-time-backport
/**
* {@inheritDoc}
* @throws DateTimeException {@inheritDoc}
* @throws ArithmeticException {@inheritDoc}
*/
@Override
public YearMonth minus(long amountToSubtract, TemporalUnit unit) {
return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE, unit).plus(1, unit) : plus(-amountToSubtract, unit));
}
代码示例来源:origin: owlike/genson
private static YearMonth fromEpochMonth(long months){
return EPOCH_YEAR_MONTH.plus(months, ChronoUnit.MONTHS);
}
}
代码示例来源:origin: OpenGamma/Strata
public void coverage() {
InflationNodalCurveDefinition test = new InflationNodalCurveDefinition(
UNDERLYING_DEF, LAST_FIX_MONTH, LAST_FIX_VALUE, SEASONALITY_DEF);
coverImmutableBean(test);
InterpolatedNodalCurveDefinition underlyingDef2 = InterpolatedNodalCurveDefinition.builder()
.name(CurveName.of("foo"))
.xValueType(ValueType.YEAR_FRACTION)
.yValueType(ValueType.ZERO_RATE)
.dayCount(ACT_365F)
.nodes(NODES)
.interpolator(CurveInterpolators.LINEAR)
.extrapolatorLeft(CurveExtrapolators.FLAT)
.extrapolatorRight(CurveExtrapolators.FLAT)
.build();
SeasonalityDefinition seasonalityDef2 =
SeasonalityDefinition.of(SEASONALITY_ADDITIVE, ShiftType.SCALED);
InflationNodalCurveDefinition test2 = new InflationNodalCurveDefinition(
underlyingDef2, LAST_FIX_MONTH.plus(Period.ofMonths(1)), LAST_FIX_VALUE + 1.0d, seasonalityDef2);
coverBeanEquals(test, test2);
}
内容来源于网络,如有侵权,请联系作者删除!