示例#1
0
 /**
  * Returns a copy of this time minus the specified number of millis.
  *
  * <p>This time instance is immutable and unaffected by this method call.
  *
  * <p>The following three lines are identical in effect:
  *
  * <pre>
  * TimeOfDay subtracted = dt.minusMillis(6);
  * TimeOfDay subtracted = dt.minus(Period.millis(6));
  * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.millis(), -6);
  * </pre>
  *
  * @param millis the amount of millis to subtract, may be negative
  * @return the new time minus the increased millis
  * @since 1.1
  */
 public TimeOfDay minusMillis(int millis) {
   return withFieldAdded(DurationFieldType.millis(), FieldUtils.safeNegate(millis));
 }
示例#2
0
 /**
  * Returns a copy of this time minus the specified number of seconds.
  *
  * <p>This time instance is immutable and unaffected by this method call.
  *
  * <p>The following three lines are identical in effect:
  *
  * <pre>
  * TimeOfDay subtracted = dt.minusSeconds(6);
  * TimeOfDay subtracted = dt.minus(Period.seconds(6));
  * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.seconds(), -6);
  * </pre>
  *
  * @param seconds the amount of seconds to subtract, may be negative
  * @return the new time minus the increased seconds
  * @since 1.1
  */
 public TimeOfDay minusSeconds(int seconds) {
   return withFieldAdded(DurationFieldType.seconds(), FieldUtils.safeNegate(seconds));
 }
示例#3
0
 /**
  * Returns a new instance with the hours value negated.
  *
  * @return the new period with a negated value
  * @throws ArithmeticException if the result overflows an int
  */
 public Hours negated() {
   return Hours.hours(FieldUtils.safeNegate(getValue()));
 }
示例#4
0
 /**
  * Returns a copy of this time minus the specified number of hours.
  *
  * <p>This time instance is immutable and unaffected by this method call.
  *
  * <p>The following three lines are identical in effect:
  *
  * <pre>
  * TimeOfDay subtracted = dt.minusHours(6);
  * TimeOfDay subtracted = dt.minus(Period.hours(6));
  * TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.hours(), -6);
  * </pre>
  *
  * @param hours the amount of hours to subtract, may be negative
  * @return the new time minus the increased hours
  * @since 1.1
  */
 public TimeOfDay minusHours(int hours) {
   return withFieldAdded(DurationFieldType.hours(), FieldUtils.safeNegate(hours));
 }
示例#5
0
 /**
  * Returns a new instance with the specified number of hours taken away.
  *
  * <p>This instance is immutable and unaffected by this method call.
  *
  * @param hours the amount of hours to take away, may be negative
  * @return the new period minus the specified number of hours
  * @throws ArithmeticException if the result overflows an int
  */
 public Hours minus(int hours) {
   return plus(FieldUtils.safeNegate(hours));
 }