本文整理了Java中java.time.Period.getUnits()
方法的一些代码示例,展示了Period.getUnits()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Period.getUnits()
方法的具体详情如下:
包路径:java.time.Period
类名称:Period
方法名:getUnits
暂无
代码示例来源:origin: OpenGamma/Strata
/**
* Gets the units supported by a tenor.
* <p>
* This returns a list containing years, months and days.
* Note that weeks are not included.
* <p>
* This method implements {@link TemporalAmount}.
* It is not intended to be called directly.
*
* @return a list containing the years, months and days units
*/
@Override
public List<TemporalUnit> getUnits() {
return period.getUnits();
}
代码示例来源:origin: OpenGamma/Strata
/**
* Gets the unit of this periodic frequency.
* <p>
* This returns a list containing years, months and days.
* Note that weeks are not included.
* <p>
* The 'Term' period is returned as a period of 10,000 years.
* <p>
* This method implements {@link TemporalAmount}.
* It is not intended to be called directly.
*
* @return a list containing the years, months and days units
*/
@Override
public List<TemporalUnit> getUnits() {
return period.getUnits();
}
代码示例来源:origin: zeebe-io/zeebe
public Interval(Period period, Duration duration) {
this.period = period;
this.duration = duration;
this.units = new ArrayList<>();
this.units.addAll(period.getUnits());
this.units.addAll(duration.getUnits());
}
代码示例来源:origin: metatron-app/metatron-discovery
@Override
public List<TemporalUnit> getUnits() {
return Stream.concat(period.getUnits().stream(), duration.getUnits().stream())
.collect(Collectors.toList());
}
代码示例来源:origin: io.zeebe/zb-bpmn-model
public Interval(Period period, Duration duration) {
this.period = period;
this.duration = duration;
this.units = new ArrayList<>();
this.units.addAll(period.getUnits());
this.units.addAll(duration.getUnits());
}
代码示例来源:origin: metatron-app/metatron-discovery
@Override
public long get(final TemporalUnit unit) {
return period.getUnits().contains(unit) ? period.get(unit) : duration.get(unit);
}
内容来源于网络,如有侵权,请联系作者删除!