RTI Connext Java API  Version 6.1.1

Type for time representation. More...

Inheritance diagram for Time_t:
Copyable

Public Member Functions

 Time_t (Time_t time)
 Copy constructor. More...
 
 Time_t (int sec, int nanosec)
 Constructor. More...
 
 Time_t ()
 Construct a new (invalid) Time_t. More...
 
boolean is_invalid ()
 
boolean is_zero ()
 Check if time is zero. More...
 
Object copy_from (Object src)
 Copy value of a data type from source. More...
 

Static Public Member Functions

static Time_t from_micros (long micros)
 Creates a new time object from a time expressed in microseconds. More...
 
static Time_t from_nanos (long nanos)
 Creates a new time object from a time expressed in nanoseconds. More...
 
static Time_t from_millis (long millis)
 Creates a new time object from a time expressed in milliseconds. More...
 
static Time_t from_seconds (int seconds)
 Creates a new time object from a time expressed in seconds. More...
 

Public Attributes

int sec
 seconds More...
 
int nanosec
 nanoseconds More...
 

Static Public Attributes

static final int TIME_INVALID_SEC
 A sentinel indicating an invalid second of time. More...
 
static final int TIME_INVALID_NSEC
 A sentinel indicating an invalid nano-second of time. More...
 
static final Time_t TIME_INVALID
 A sentinel indicating an invalid time. More...
 
static final Time_t TIME_MAX
 The maximum value of time. More...
 

Detailed Description

Type for time representation.

A com.rti.dds.infrastructure.Time_t represents a moment in time.

Constructor & Destructor Documentation

◆ Time_t() [1/3]

Time_t ( Time_t  time)

Copy constructor.

Parameters
timeThe instance to copy. It must not be null.

References Time_t.nanosec, and Time_t.sec.

◆ Time_t() [2/3]

Time_t ( int  sec,
int  nanosec 
)

Constructor.

Parameters
secmust be >=0
nanosecmust be >=0 and < 1000000000

References Time_t.nanosec, and Time_t.sec.

◆ Time_t() [3/3]

Time_t ( )

Construct a new (invalid) Time_t.

The primary purpose of this constructor is to satisfy the java.io.Serializable interface. The resulting object will have invalid seconds and nanoseconds.

References Time_t.TIME_INVALID_NSEC, and Time_t.TIME_INVALID_SEC.

Referenced by Time_t.copy_from(), Time_t.from_micros(), Time_t.from_millis(), Time_t.from_nanos(), and Time_t.from_seconds().

Member Function Documentation

◆ from_micros()

static Time_t from_micros ( long  micros)
static

Creates a new time object from a time expressed in microseconds.

In case of an overflow this function returns com.rti.dds.infrastructure.Time_t.TIME_MAX.

References Time_t.TIME_MAX, and Time_t.Time_t().

◆ from_nanos()

static Time_t from_nanos ( long  nanos)
static

Creates a new time object from a time expressed in nanoseconds.

In case of an overflow this function returns com.rti.dds.infrastructure.Time_t.TIME_MAX.

References Time_t.TIME_MAX, and Time_t.Time_t().

◆ from_millis()

static Time_t from_millis ( long  millis)
static

Creates a new time object from a time expressed in milliseconds.

In case of an overflow this function returns com.rti.dds.infrastructure.Time_t.TIME_MAX.

References Time_t.TIME_MAX, and Time_t.Time_t().

◆ from_seconds()

static Time_t from_seconds ( int  seconds)
static

Creates a new time object from a time expressed in seconds.

References Time_t.Time_t().

◆ is_invalid()

boolean is_invalid ( )
Returns
com.rti.dds.infrastructure.true if the given time is not valid (i.e. is negative)

Referenced by DynamicDataWriter.register_instance_w_timestamp().

◆ is_zero()

boolean is_zero ( )

Check if time is zero.

Returns
com.rti.dds.infrastructure.true if the given time is equal to com.rti.dds.infrastructure.Time_t.ZERO or com.rti.dds.infrastructure.false otherwise.

◆ copy_from()

Object copy_from ( Object  src)

Copy value of a data type from source.

Copy data into this object from another. This copy is intended to be a deep copy, so that all data members (recursively) are copied (not just resetting Object references).

This operation returns the object that is copied if copy is successful.

Parameters
src<<in>> The Object which contains the data to be copied.
Returns
Generally, return this but special cases (such as Enum) exist.
Exceptions
NullPointerExceptionIf src is null.
ClassCastExceptionIf src is not the same type as this.

Implements Copyable.

References Time_t.nanosec, Time_t.sec, and Time_t.Time_t().

Referenced by WriteParams_t.copy_from().

Member Data Documentation

◆ TIME_INVALID_SEC

final int TIME_INVALID_SEC
static

A sentinel indicating an invalid second of time.

Referenced by Time_t.Time_t().

◆ TIME_INVALID_NSEC

final int TIME_INVALID_NSEC
static

A sentinel indicating an invalid nano-second of time.

Referenced by Time_t.Time_t().

◆ TIME_INVALID

final Time_t TIME_INVALID
static

A sentinel indicating an invalid time.

Referenced by WriteParams_t.copy_from().

◆ TIME_MAX

final Time_t TIME_MAX
static

The maximum value of time.

Referenced by Time_t.from_micros(), Time_t.from_millis(), and Time_t.from_nanos().

◆ sec

◆ nanosec