RTI Connext Java API  Version 5.1.0
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)
 
static Duration_t from_nanos (long nanos)
 
static Duration_t from_millis (long millis)
 
static Duration_t from_seconds (long 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 = new Duration_t()
 
static final Duration_t DURATION_INFINITE
 
static final Duration_t DURATION_AUTO
 

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

static Duration_t from_nanos ( long  nanos)
static

Creates a new duration object from a duration expressed in nanoseconds

static Duration_t from_millis ( long  millis)
static

Creates a new duration object from a duration expressed in milliseconds

static Duration_t from_seconds ( long  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: d.add(Duration_t.DURATION_INFINITE).is_infinite()

Duration_t subtract ( Duration_t  other)

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

Special cases: d.substract(Duration_t.DURATION_INFINITE).is_zero() Duration_t.DURATION_INFINITE.substract(d).is_infinite() Duration_t.DURATION_INFINITE.substract(Duration_t.DURATION_INFINITE).is_infinite() d1.substract(d2).is_zero() if d2 is greater or equal than d1

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 = new Duration_t()
static

Zero duration

final Duration_t DURATION_INFINITE
static
Initial value:

Infinite duration

final Duration_t DURATION_AUTO
static
Initial value:

Auto duration

int sec

seconds

int nanosec

nanoseconds


RTI Connext Java API Version 5.1.0 Copyright © Mon Feb 3 2014 Real-Time Innovations, Inc