![]() |
OpenSplice Java 5 DCPS
v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
A span of elapsed time expressed with nanosecond precision. More...
Public Member Functions | |
abstract Duration | add (Duration duration) |
abstract Duration | add (long duration, TimeUnit unit) |
abstract long | getDuration (TimeUnit inThisUnit) |
Truncate this duration to a whole-number quantity of the given time unit. More... | |
ServiceEnvironment | getEnvironment () |
abstract long | getRemainder (TimeUnit primaryUnit, TimeUnit remainderUnit) |
If getting the magnitude of this duration in the given primaryUnit would cause truncation with respect to the given remainderUnit , return the magnitude of the truncation in the latter (presumably finer-grained) unit. More... | |
abstract boolean | isInfinite () |
Report whether this duration lasts forever. More... | |
abstract boolean | isZero () |
Report whether this duration lasts no time at all. More... | |
abstract Duration | subtract (Duration duration) |
abstract Duration | subtract (long duration, TimeUnit unit) |
Static Public Member Functions | |
static Duration | infiniteDuration (ServiceEnvironment env) |
static Duration | newDuration (long duration, TimeUnit unit, ServiceEnvironment env) |
Construct a time duration of the given magnitude. More... | |
static Duration | zeroDuration (ServiceEnvironment env) |
A span of elapsed time expressed with nanosecond precision.
Instances of this type are immutable.
Definition at line 35 of file Duration.java.
|
abstract |
|
abstract |
Truncate this duration to a whole-number quantity of the given time unit.
For example, if this duration is equal to one second plus 100 nanoseconds, calling this method with an argument of TimeUnit#SECONDS will result in the value 1
.
If this duration is infinite, this method shall return Long#MAX_VALUE, regardless of the units given.
If this duration cannot be expressed in the given units without overflowing, this method shall return Long#MAX_VALUE. In such a case, the caller may wish to use this method in combination with getRemainder(TimeUnit, TimeUnit) to obtain the full duration without lack of precision.
inThisUnit | The time unit in which the return result will be measured. |
|
inherited |
Implemented in org.omg.dds.core.ServiceEnvironment, org.opensplice.dds.sub.ReflectionDataReader< TYPE, OUT_TYPE >, org.opensplice.dds.core.ModifiableTimeImpl, org.opensplice.dds.pub.ReflectionDataWriter< TYPE >, org.opensplice.dds.core.DurationImpl, org.opensplice.dds.topic.ContentFilteredTopicImpl< TYPE >, org.opensplice.dds.sub.ReadConditionImpl< TYPE >, org.opensplice.dds.core.EntityQosImpl< T extends QosPolicy >, org.opensplice.dds.type.TypeSupportImpl< TYPE >, org.opensplice.dds.topic.PublicationBuiltinTopicDataImpl, org.opensplice.dds.topic.SubscriptionBuiltinTopicDataImpl, org.opensplice.dds.topic.TopicBuiltinTopicDataImpl, org.opensplice.dds.domain.DomainParticipantFactoryImpl, org.opensplice.dds.core.QosProviderImpl, org.opensplice.dds.core.status.OfferedIncompatibleQosStatusImpl, org.opensplice.dds.core.status.RequestedIncompatibleQosStatusImpl, org.opensplice.dds.core.InstanceHandleImpl, org.opensplice.dds.core.StatusConditionImpl< T extends Entity<?, ?>, org.opensplice.dds.core.status.LivelinessChangedStatusImpl, org.opensplice.dds.core.status.PublicationMatchedStatusImpl, org.opensplice.dds.core.status.SubscriptionMatchedStatusImpl, org.opensplice.dds.sub.SampleImpl< TYPE >, org.opensplice.dds.core.policy.ShareImpl, org.opensplice.dds.core.status.OfferedDeadlineMissedStatusImpl, org.opensplice.dds.core.status.SampleRejectedStatusImpl, org.opensplice.dds.core.WaitSetImpl, org.opensplice.dds.topic.ParticipantBuiltinTopicDataImpl, org.opensplice.dds.core.status.RequestedDeadlineMissedStatusImpl, org.opensplice.dds.topic.BuiltinTopicKeyImpl, org.opensplice.dds.core.GuardConditionImpl, org.opensplice.dds.core.event.AllDataDisposedEventImpl< TYPE >, org.opensplice.dds.core.policy.QosPolicyCountImpl, org.opensplice.dds.core.status.InconsistentTopicStatusImpl, org.opensplice.dds.core.status.LivelinessLostStatusImpl, org.opensplice.dds.core.status.SampleLostStatusImpl, org.opensplice.dds.core.policy.QosPolicyImpl, org.opensplice.dds.core.status.AllDataDisposedStatusImpl, org.opensplice.dds.core.IllegalArgumentExceptionImpl, org.opensplice.dds.core.InconsistentPolicyExceptionImpl, org.opensplice.dds.core.policy.PolicyFactoryImpl, org.opensplice.dds.core.policy.TypeConsistencyEnforcementImpl, org.opensplice.dds.core.PreconditionNotMetExceptionImpl, org.opensplice.dds.core.AlreadyClosedExceptionImpl, org.opensplice.dds.core.IllegalOperationExceptionImpl, org.opensplice.dds.core.ImmutablePolicyExceptionImpl, org.opensplice.dds.core.NotEnabledExceptionImpl, org.opensplice.dds.core.OutOfResourcesExceptionImpl, org.opensplice.dds.core.DDSExceptionImpl, org.opensplice.dds.core.status.DataAvailableStatusImpl, and org.opensplice.dds.core.status.DataOnReadersStatusImpl.
|
abstract |
If getting the magnitude of this duration in the given primaryUnit
would cause truncation with respect to the given remainderUnit
, return the magnitude of the truncation in the latter (presumably finer-grained) unit.
For example, if this duration is equal to one second plus 100 nanoseconds, calling this method with arguments of TimeUnit#SECONDS and TimeUnit#NANOSECONDS respectively will result in the value 100
.
This method is equivalent to the following pseudo-code:
(this - getDuration(primaryUnit)).getDuration(remainderUnit)
If remainderUnit
is represents a coarser granularity than primaryUnit
(for example, the former is TimeUnit#MILLISECONDS but the latter is TimeUnit#SECONDS), this method shall return 0
.
If the resulting duration cannot be expressed in the given units without overflowing, this method shall return Long#MAX_VALUE.
primaryUnit | |
remainderUnit | The time unit in which the return result will be measured. |
|
static |
env | Identifies the Service instance to which the object will belong. |
Definition at line 81 of file Duration.java.
|
abstract |
Report whether this duration lasts forever.
If this duration is infinite, the following relationship shall be true:
this.equals(infiniteDuration(this.getEnvironment()))
|
abstract |
Report whether this duration lasts no time at all.
The result of this method is equivalent to the following:
this.getDuration(TimeUnit.NANOSECONDS) == 0;
|
static |
Construct a time duration of the given magnitude.
A duration of magnitude Long#MAX_VALUE indicates an infinite duration, regardless of the units specified.
env | Identifies the Service instance to which the new object will belong. |
Definition at line 62 of file Duration.java.
|
abstract |
|
static |
env | Identifies the Service instance to which the object will belong. |
Definition at line 97 of file Duration.java.