org.joda.time.Partial.withFieldAddWrapped()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(157)

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

Partial.withFieldAddWrapped介绍

[英]Gets a copy of this Partial with the value of the specified field increased. If this partial does not support the field, an exception is thrown.

If the addition is zero, then this is returned. The addition will overflow into larger fields (eg. minute to hour). If the maximum is reached, the addition will wra.
[中]获取指定字段值增加的此分部的副本。如果此部分不支持该字段,则会引发异常。
如果加法为零,则返回this。加法将溢出到更大的字段中(如分钟到小时)。如果达到最大值,则添加量将为wra。

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

} else {
 if (JodaTimeUtils.hasField(unsupported, DurationFieldType.months()) && unsupported.getMonths() % 3 == 0 && JodaTimeUtils.hasField(p.base, JodaTimeUtils.QuarterOfYear)) {
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Quarters, unsupported.getMonths() / 3);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.HalfYears, unsupported.getMonths() / 6);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Decades, unsupported.getYears() / 10);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withYears(0);

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

} else {
 if (JodaTimeUtils.hasField(unsupported, DurationFieldType.months()) && unsupported.getMonths() % 3 == 0 && JodaTimeUtils.hasField(p.base, JodaTimeUtils.QuarterOfYear)) {
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Quarters, unsupported.getMonths() / 3);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.HalfYears, unsupported.getMonths() / 6);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Decades, unsupported.getYears() / 10);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withYears(0);

代码示例来源:origin: com.guokr/stan-cn-com

} else {
 if (JodaTimeUtils.hasField(unsupported, DurationFieldType.months()) && unsupported.getMonths() % 3 == 0 && JodaTimeUtils.hasField(p.base, JodaTimeUtils.QuarterOfYear)) {
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Quarters, unsupported.getMonths() / 3);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.HalfYears, unsupported.getMonths() / 6);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withMonths(0);
  Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Decades, unsupported.getYears() / 10);
  p = new PartialTime(p, p2);
  unsupported = unsupported.withYears(0);

代码示例来源:origin: edu.stanford.nlp/corenlp

Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Quarters, unsupported.getMonths() / 3);
p = new PartialTime(p, p2);
unsupported = unsupported.withMonths(0);
Partial p2 = p.base.withFieldAddWrapped(JodaTimeUtils.Decades, unsupported.getYears() / 10);
p = new PartialTime(p, p2);
unsupported = unsupported.withYears(0);

相关文章