public interface Duration extends Comparable<Duration>
| Modifier and Type | Method and Description |
|---|---|
Duration |
add(Duration addend)
Returns a new duration that equals the combined length of this and the given duration in the
unit of this duration.
|
long |
getLength(TimeUnit unit)
Returns the length of this duration in the given
TimeUnit. |
TimeUnit |
getNativeUnit()
Returns the native unit used by this duration.
|
boolean |
isZeroLength()
Whether this duration is of zero length.
|
Duration |
multiply(double multiplier)
Multiplies the length of this duration by the given multiplier.
|
Duration |
sub(Duration subtrahend)
Returns a new duration that equals the length of this duration minus the length of the given duration
in the unit of this duration.
|
compareTolong getLength(TimeUnit unit)
TimeUnit.unit - boolean isZeroLength()
TimeUnit getNativeUnit()
Duration sub(Duration subtrahend)
subtrahend - Duration add(Duration addend)
addend - Duration multiply(double multiplier)
multiplier - Copyright © 2012–2014. All rights reserved.