/** @return A duration that represents the sum of {@code this} and <var>other</var> */ public Duration add(Duration other) { return new Duration(this.ms + other.ms); }
/** @return A duration that is <var>factor</var> as long as this duration */ public Duration multiply(double factor) { return new Duration((long) (this.ms * factor)); }
/** @return The length of the interval from <var>other</var> to {@code this} */ public Duration subtract(PointOfTime other) { return new Duration(this.ms - other.ms); }
/** @return The length of the interval from {@code other} to {@code this} */ public Duration subtract(PointOfTime other) { return new Duration(this.ms - other.ms); }
/** @return A duration which is one {@code divisor}th of this duration long */ public Duration divide(double divisor) { return new Duration((long) (this.ms / divisor)); }
/** @return A duration which is one <var>divisor</var>th of this duration long */ public Duration divide(double divisor) { return new Duration((long) (this.ms / divisor)); }
/** @return A duration that represents the sum of {@code this} and {@code other} */ public Duration add(Duration other) { return new Duration(this.ms + other.ms); }
/** @return A duration that is {@code factor} as long as this duration */ public Duration multiply(double factor) { return new Duration((long) (this.ms * factor)); }
/** The duration of this time interval */ @Nullable public Duration getDuration() { PointOfTime beginning = this.beginning; Duration duration = this.duration; PointOfTime ending = this.ending; return ( beginning != null && duration == null && ending != null ? new Duration(ending.milliseconds() - beginning.milliseconds()) : this.duration ); }
/** The duration of this time interval */ @Nullable public Duration getDuration() { PointOfTime beginning = this.beginning; Duration duration = this.duration; PointOfTime ending = this.ending; return ( beginning != null && duration == null && ending != null ? new Duration(ending.milliseconds() - beginning.milliseconds()) : this.duration ); }
); if (secondsPerUnit != null) { Duration remainingDuration = new Duration(remainingQuantity * secondsPerUnit);
final Duration[] previousDuration = { new Duration(0) };