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

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

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

Partial.withPeriodAdded介绍

[英]Gets a copy of this Partial with the specified period added.

If the addition is zero, then this is returned. Fields in the period that aren't present in the partial are ignored.

This method is typically used to add multiple copies of complex period instances. Adding one field is best achieved using the method #withFieldAdded(DurationFieldType,int).
[中]获取添加了指定句点的此分部的副本。
如果加法为零,则返回this。将忽略部分字段中不存在的期间字段。
此方法通常用于添加复杂时段实例的多个副本。最好使用#withFieldAdded(DurationFieldType,int)方法添加一个字段。

代码示例

代码示例来源:origin: joda-time/joda-time

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: joda-time/joda-time

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: JodaOrg/joda-time

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

@Override
protected PartialTime addSupported(Period p, int scalar) {
 return new CompositePartialTime(this, base.withPeriodAdded(p, 1), poy, dow, tod);
}

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

protected PartialTime addSupported(Period p, int scalar) {
 return new PartialTime(base.withPeriodAdded(p, scalar));
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Gets a copy of this instance with the specified period take away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: org.joda/com.springsource.org.joda.time

/**
 * Gets a copy of this instance with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 *
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added
 * @throws ArithmeticException if the new datetime exceeds the capacity of a long
 */
public Partial plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

protected PartialTime addSupported(Period p, int scalar) {
 return new PartialTime(base.withPeriodAdded(p, scalar));
}

相关文章