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

x33g5p2x  于2022-01-23 转载在 其他  
字(13.8k)|赞(0)|评价(0)|浏览(136)

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

LocalDate.withPeriodAdded介绍

[英]Returns a copy of this date with the specified period added.

If the addition is zero, then this is returned.

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).

Unsupported time fields are ignored, thus adding a period of 24 hours will not have any effect.
[中]返回添加了指定期间的此日期的副本。
如果加法为零,则返回this
此方法通常用于添加复杂时段实例的多个副本。添加一个字段最好使用#withFieldAdded(DurationFieldType,int)或#plusYears(int)等方法。
不支持的时间字段将被忽略,因此添加24小时不会产生任何效果。

代码示例

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus adding a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to add to this one, null means zero
 * @return a copy of this date with the period added
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate plus(ReadablePeriod period) {
  return withPeriodAdded(period, 1);
}

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

/**
 * Returns a copy of this date 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)}.
 * <p>
 * Unsupported time fields are ignored, thus subtracting a period of 24 hours
 * will not have any effect.
 *
 * @param period  the period to reduce this instant by
 * @return a copy of this LocalDate with the period taken away
 * @throws ArithmeticException if the result exceeds the internal capacity
 */
public LocalDate minus(ReadablePeriod period) {
  return withPeriodAdded(period, -1);
}

相关文章