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

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

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

YearMonth.withPeriodAdded介绍

[英]Returns a copy of this year-month 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 methods like #withFieldAdded(DurationFieldType,int)or #plusYears(int).
[中]返回添加了指定期间的本年月份的副本。
如果加法为零,则返回this。将忽略部分字段中不存在的期间字段。
此方法通常用于添加复杂时段实例的多个副本。添加一个字段最好使用#withFieldAdded(DurationFieldType,int)或#plusYears(int)等方法。

代码示例

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

代码示例来源:origin: redfish64/TinyTravelTracker

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this year-month with the specified period added.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to add complex period instances.
 * Adding one field is best achieved using methods
 * like {@link #plusYears(int)}.
 * 
 * @param period  the duration to add to this one, null means zero
 * @return a copy of this instance with the period added, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this year-month with the specified period taken away.
 * <p>
 * If the amount is zero or null, then <code>this</code> is returned.
 * <p>
 * This method is typically used to subtract complex period instances.
 * Subtracting one field is best achieved using methods
 * like {@link #minusYears(int)}.
 * 
 * @param period  the period to reduce this instant by
 * @return a copy of this instance with the period taken away, never null
 * @throws ArithmeticException if the new year-month exceeds the capacity
 */
public YearMonth minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

相关文章