19 package org.omg.dds.core;
21 import java.io.Serializable;
22 import java.util.concurrent.TimeUnit;
33 @Extensibility(Extensibility.Kind.FINAL_EXTENSIBILITY)
36 implements Comparable<Duration>, Serializable,
DDSObject 42 private static final long serialVersionUID = 6926514364942353575L;
68 throw new IllegalArgumentException(
69 "Invalid ServiceEnvironment (null) provided.");
84 throw new IllegalArgumentException(
85 "Invalid ServiceEnvironment (null) provided.");
100 throw new IllegalArgumentException(
101 "Invalid ServiceEnvironment (null) provided.");
136 public abstract long getDuration(TimeUnit inThisUnit);
171 TimeUnit primaryUnit, TimeUnit remainderUnit);
184 public abstract boolean isZero();
211 public abstract Duration add(
long duration, TimeUnit unit);
abstract Duration subtract(Duration duration)
abstract boolean isInfinite()
Report whether this duration lasts forever.
abstract Duration add(Duration duration)
abstract ServiceProviderInterface getSPI()
This method is not intended for use by applications.
static Duration infiniteDuration(ServiceEnvironment env)
abstract boolean isZero()
Report whether this duration lasts no time at all.
abstract long getRemainder(TimeUnit primaryUnit, TimeUnit remainderUnit)
If getting the magnitude of this duration in the given primaryUnit would cause truncation with respec...
A supertype of all DDS classes and interfaces.
abstract long getDuration(TimeUnit inThisUnit)
Truncate this duration to a whole-number quantity of the given time unit.
Duration newDuration(long duration, TimeUnit unit)
Construct a org.omg.dds.core.Duration of the given magnitude.
A span of elapsed time expressed with nanosecond precision.
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
Duration infiniteDuration()
static Duration zeroDuration(ServiceEnvironment env)
static Duration newDuration(long duration, TimeUnit unit, ServiceEnvironment env)
Construct a time duration of the given magnitude.