| 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.
|
int |
compareTo(Duration o) |
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.
|
public static Duration INSTANCE
public int compareTo(Duration o)
compareTo in interface Comparable<Duration>public long getLength(TimeUnit unit)
DurationTimeUnit.public TimeUnit getNativeUnit()
DurationgetNativeUnit in interface Durationpublic Duration sub(Duration subtrahend)
Durationpublic Duration add(Duration addend)
Durationpublic boolean isZeroLength()
DurationisZeroLength in interface DurationCopyright © 2012–2014. All rights reserved.