OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.core.ModifiableTime Class Referenceabstract
Inheritance diagram for org.omg.dds.core.ModifiableTime:
Inheritance graph
Collaboration diagram for org.omg.dds.core.ModifiableTime:
Collaboration graph

Public Member Functions

abstract void add (Duration duration)
 Increment this time by the given amount. More...
 
abstract void add (long duration, TimeUnit unit)
 Increment this time by the given amount. More...
 
abstract void copyFrom (Time src)
 Overwrite the state of this object with that of the given object. More...
 
ServiceEnvironment getEnvironment ()
 
abstract long getRemainder (TimeUnit primaryUnit, TimeUnit remainderUnit)
 If getting the magnitude of this time 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 long getTime (TimeUnit inThisUnit)
 Truncate this time to a whole-number quantity of the given time unit. More...
 
abstract Time immutableCopy ()
 
abstract boolean isValid ()
 
abstract ModifiableTime modifiableCopy ()
 
abstract void setTime (long time, TimeUnit unit)
 
abstract void subtract (Duration duration)
 Decrement this time by the given amount. More...
 
abstract void subtract (long duration, TimeUnit unit)
 Decrement this time by the given amount. More...
 

Static Public Member Functions

static Time invalidTime (ServiceEnvironment env)
 
static ModifiableTime newTime (long time, TimeUnit units, ServiceEnvironment env)
 Construct a specific instant in time. More...
 

Detailed Description

Definition at line 24 of file ModifiableTime.java.

Member Function Documentation

◆ add() [1/2]

abstract void org.omg.dds.core.ModifiableTime.add ( Duration  duration)
abstract

Increment this time by the given amount.

◆ add() [2/2]

abstract void org.omg.dds.core.ModifiableTime.add ( long  duration,
TimeUnit  unit 
)
abstract

Increment this time by the given amount.

◆ copyFrom()

abstract void org.omg.dds.core.ModifiableTime.copyFrom ( Time  src)
abstract

Overwrite the state of this object with that of the given object.

◆ getEnvironment()

ServiceEnvironment org.omg.dds.core.DDSObject.getEnvironment ( )
inherited
Returns
the org.omg.dds.core.ServiceEnvironment object that directly or indirectly was used to create this object.

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.

◆ getRemainder()

abstract long org.omg.dds.core.Time.getRemainder ( TimeUnit  primaryUnit,
TimeUnit  remainderUnit 
)
abstractinherited

If getting the magnitude of this time 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 time is equal to one second plus 100 nanoseconds since the start of the epoch, 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 - getTime(primaryUnit)).getTime(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 time cannot be expressed in the given units without overflowing, this method shall return Long#MAX_VALUE.

Parameters
primaryUnit
remainderUnitThe time unit in which the return result will be measured.
See also
getTime(TimeUnit)
Long::MAX_VALUE
TimeUnit

◆ getTime()

abstract long org.omg.dds.core.Time.getTime ( TimeUnit  inThisUnit)
abstractinherited

Truncate this time to a whole-number quantity of the given time unit.

For example, if this time is equal to one second plus 100 nanoseconds since the start of the epoch, calling this method with an argument of TimeUnit#SECONDS will result in the value 1.

If this time is invalid, this method shall return a negative value, regardless of the units given.

If this time 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 time without lack of precision.

Parameters
inThisUnitThe time unit in which the return result will be measured.
See also
getRemainder(TimeUnit, TimeUnit)
Long::MAX_VALUE
TimeUnit

◆ immutableCopy()

abstract Time org.omg.dds.core.ModifiableTime.immutableCopy ( )
abstract
Returns
an immutable copy of this object's state.

◆ invalidTime()

static Time org.omg.dds.core.Time.invalidTime ( ServiceEnvironment  env)
staticinherited
Parameters
envIdentifies the Service instance to which the object will belong.
Returns
An unmodifiable org.omg.dds.core.Time that is not valid.

Definition at line 81 of file Time.java.

◆ isValid()

abstract boolean org.omg.dds.core.Time.isValid ( )
abstractinherited
Returns
whether this time represents a meaningful instant in time.

◆ modifiableCopy()

abstract ModifiableTime org.omg.dds.core.Time.modifiableCopy ( )
abstractinherited
Returns
a modifiable copy of this object's state.

◆ newTime()

static ModifiableTime org.omg.dds.core.Time.newTime ( long  time,
TimeUnit  units,
ServiceEnvironment  env 
)
staticinherited

Construct a specific instant in time.

Negative values are considered invalid and will result in the construction of a time t such that:

t.isValid() == false

Parameters
envIdentifies the Service instance to which the new object will belong.
See also
isValid()

Definition at line 62 of file Time.java.

◆ setTime()

abstract void org.omg.dds.core.ModifiableTime.setTime ( long  time,
TimeUnit  unit 
)
abstract

◆ subtract() [1/2]

abstract void org.omg.dds.core.ModifiableTime.subtract ( Duration  duration)
abstract

Decrement this time by the given amount.

◆ subtract() [2/2]

abstract void org.omg.dds.core.ModifiableTime.subtract ( long  duration,
TimeUnit  unit 
)
abstract

Decrement this time by the given amount.


The documentation for this class was generated from the following file: