RTI Connext Java API  Version 5.3.1
 All Classes Namespaces Functions Variables Groups Pages
Duration_t Class Reference

Type for duration representation. More...

Inherits Struct, and Externalizable.

Public Member Functions

 Duration_t (Duration_t duration)
 Copy constructor.
 
 Duration_t (int sec, int nanosec)
 
boolean is_zero ()
 
boolean is_infinite ()
 
boolean is_auto ()
 
Duration_t add (Duration_t other)
 
Duration_t subtract (Duration_t other)
 
- Public Member Functions inherited from Struct
abstract boolean equals (Object obj)
 
abstract int hashCode ()
 
String toString ()
 

Static Public Member Functions

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

Public Attributes

int sec
 seconds
 
int nanosec
 nanoseconds
 

Static Public Attributes

static final int DURATION_ZERO_SEC
 A zero-length second period of time.
 
static final int DURATION_ZERO_NSEC
 A zero-length nano-second period of time.
 
static final int DURATION_INFINITE_SEC
 An infinite second period of time.
 
static final int DURATION_INFINITE_NSEC
 An infinite nano-second period of time.
 
static final int DURATION_AUTO_SEC
 An auto second period of time.
 
static final int DURATION_AUTO_NSEC
 An auto nano-second period of time.
 
static final Duration_t DURATION_ZERO
 A zero-length period of time.
 
static final Duration_t DURATION_INFINITE
 An infinite period of time.
 
static final Duration_t DURATION_AUTO
 Duration is automatically assigned.
 

Additional Inherited Members

- Protected Member Functions inherited from Struct
 Struct ()
 
abstract void pull_from_nativeI (long native_status)
 
abstract void push_to_nativeI (long native_status)
 

Detailed Description

Type for duration representation.

Represents a time interval.

Constructor & Destructor Documentation

Duration_t ( Duration_t  duration)

Copy constructor.

Parameters
durationThe duration instance to copy. It must not be null.
Duration_t ( int  sec,
int  nanosec 
)
Parameters
secmust be >=0
nanosecmust be >=0

Member Function Documentation

static Duration_t from_micros ( long  micros)
static

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

In case of an overflow this function returns com.rti.dds.infrastructure.Duration_t.DURATION_INFINITE.

static Duration_t from_nanos ( long  nanos)
static

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

In case of an overflow this function returns com.rti.dds.infrastructure.Duration_t.DURATION_INFINITE.

static Duration_t from_millis ( long  millis)
static

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

In case of an overflow this function returns com.rti.dds.infrastructure.Duration_t.DURATION_INFINITE.

static Duration_t from_seconds ( int  seconds)
static

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

boolean is_zero ( )
Returns
com.rti.dds.infrastructure.true if the given duration is of zero length.
boolean is_infinite ( )
Returns
com.rti.dds.infrastructure.true if the given duration is of infinite length.
boolean is_auto ( )
Returns
com.rti.dds.infrastructure.true if the given duration has auto value.
Duration_t add ( Duration_t  other)

Calculates a duration as the result of adding other and this.

Special case:

Duration_t subtract ( Duration_t  other)

Calculates a duration as the result of substracting other to this.

Special cases:

Member Data Documentation

final int DURATION_ZERO_SEC
static

A zero-length second period of time.

final int DURATION_ZERO_NSEC
static

A zero-length nano-second period of time.

final int DURATION_INFINITE_SEC
static

An infinite second period of time.

final int DURATION_INFINITE_NSEC
static

An infinite nano-second period of time.

final int DURATION_AUTO_SEC
static

An auto second period of time.

final int DURATION_AUTO_NSEC
static

An auto nano-second period of time.

final Duration_t DURATION_ZERO
static

A zero-length period of time.

final Duration_t DURATION_INFINITE
static

An infinite period of time.

final Duration_t DURATION_AUTO
static

Duration is automatically assigned.

int sec

seconds

int nanosec

nanoseconds


RTI Connext Java API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc