/** * Returns a copy of this year-month plus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusMonths(6); * YearMonth added = ym.plus(Period.months(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6); * </pre> * * @param months the amount of months to add, may be negative * @return the new year-month plus the increased months, never null */ public YearMonth plusMonths(int months) { return withFieldAdded(DurationFieldType.months(), months); }
/** * Returns a copy of this year-month plus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusYears(6); * YearMonth added = ym.plus(Period.years(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.years(), 6); * </pre> * * @param years the amount of years to add, may be negative * @return the new year-month plus the increased years, never null */ public YearMonth plusYears(int years) { return withFieldAdded(DurationFieldType.years(), years); }
/** * Returns a copy of this year-month plus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusYears(6); * YearMonth added = ym.plus(Period.years(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.years(), 6); * </pre> * * @param years the amount of years to add, may be negative * @return the new year-month plus the increased years, never null */ public YearMonth plusYears(int years) { return withFieldAdded(DurationFieldType.years(), years); }
/** * Returns a copy of this year-month plus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusMonths(6); * YearMonth added = ym.plus(Period.months(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6); * </pre> * * @param months the amount of months to add, may be negative * @return the new year-month plus the increased months, never null */ public YearMonth plusMonths(int months) { return withFieldAdded(DurationFieldType.months(), months); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month minus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusYears(6); * YearMonth subtracted = ym.minus(Period.years(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.years(), -6); * </pre> * * @param years the amount of years to subtract, may be negative * @return the new year-month minus the increased years, never null */ public YearMonth minusYears(int years) { return withFieldAdded(DurationFieldType.years(), FieldUtils.safeNegate(years)); }
/** * Returns a copy of this year-month minus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusYears(6); * YearMonth subtracted = ym.minus(Period.years(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.years(), -6); * </pre> * * @param years the amount of years to subtract, may be negative * @return the new year-month minus the increased years, never null */ public YearMonth minusYears(int years) { return withFieldAdded(DurationFieldType.years(), FieldUtils.safeNegate(years)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month plus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusMonths(6); * YearMonth added = ym.plus(Period.months(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6); * </pre> * * @param months the amount of months to add, may be negative * @return the new year-month plus the increased months, never null */ public YearMonth plusMonths(int months) { return withFieldAdded(DurationFieldType.months(), months); }
/** * Returns a copy of this year-month plus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusYears(6); * YearMonth added = ym.plus(Period.years(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.years(), 6); * </pre> * * @param years the amount of years to add, may be negative * @return the new year-month plus the increased years, never null */ public YearMonth plusYears(int years) { return withFieldAdded(DurationFieldType.years(), years); }
/** * Returns a copy of this year-month minus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusYears(6); * YearMonth subtracted = ym.minus(Period.years(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.years(), -6); * </pre> * * @param years the amount of years to subtract, may be negative * @return the new year-month minus the increased years, never null */ public YearMonth minusYears(int years) { return withFieldAdded(DurationFieldType.years(), FieldUtils.safeNegate(years)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month plus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusYears(6); * YearMonth added = ym.plus(Period.years(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.years(), 6); * </pre> * * @param years the amount of years to add, may be negative * @return the new year-month plus the increased years, never null */ public YearMonth plusYears(int years) { return withFieldAdded(DurationFieldType.years(), years); }
/** * Returns a copy of this year-month plus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusMonths(6); * YearMonth added = ym.plus(Period.months(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6); * </pre> * * @param months the amount of months to add, may be negative * @return the new year-month plus the increased months, never null */ public YearMonth plusMonths(int months) { return withFieldAdded(DurationFieldType.months(), months); }
/** * Returns a copy of this year-month plus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth added = ym.plusMonths(6); * YearMonth added = ym.plus(Period.months(6)); * YearMonth added = ym.withFieldAdded(DurationFieldType.months(), 6); * </pre> * * @param months the amount of months to add, may be negative * @return the new year-month plus the increased months, never null */ public YearMonth plusMonths(int months) { return withFieldAdded(DurationFieldType.months(), months); }
/** * Returns a copy of this year-month minus the specified number of years. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusYears(6); * YearMonth subtracted = ym.minus(Period.years(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.years(), -6); * </pre> * * @param years the amount of years to subtract, may be negative * @return the new year-month minus the increased years, never null */ public YearMonth minusYears(int years) { return withFieldAdded(DurationFieldType.years(), FieldUtils.safeNegate(years)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }
/** * Returns a copy of this year-month minus the specified number of months. * <p> * This year-month instance is immutable and unaffected by this method call. * <p> * The following three lines are identical in effect: * <pre> * YearMonth subtracted = ym.minusMonths(6); * YearMonth subtracted = ym.minus(Period.months(6)); * YearMonth subtracted = ym.withFieldAdded(DurationFieldType.months(), -6); * </pre> * * @param months the amount of months to subtract, may be negative * @return the new year-month minus the increased months, never null */ public YearMonth minusMonths(int months) { return withFieldAdded(DurationFieldType.months(), FieldUtils.safeNegate(months)); }