dxFeed .Net API  7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
com.dxfeed.util.TimePeriod Class Reference

Value class for period of time with support for ISO8601 duration format. More...

Collaboration diagram for com.dxfeed.util.TimePeriod:
[legend]

Public Member Functions

override string ToString ()
 
long GetTime ()
 Returns value in milliseconds. More...
 
long GetNanos ()
 Returns value in nanoseconds. More...
 
override bool Equals (object o)
 
override int GetHashCode ()
 

Static Public Member Functions

static TimePeriod ValueOf (long value)
 Returns TimePeriod with value milliseconds. More...
 
static TimePeriod ValueOf (string value)
 Returns TimePeriod represented with a given string. More...
 

Static Public Attributes

static readonly TimePeriod ZERO = new TimePeriod(0)
 Time-period of zero. More...
 

Protected Member Functions

 TimePeriod (long value)
 

Static Protected Member Functions

static long Parse (string value)
 

Detailed Description

Value class for period of time with support for ISO8601 duration format.

Member Function Documentation

◆ GetNanos()

long com.dxfeed.util.TimePeriod.GetNanos ( )
inline

Returns value in nanoseconds.

Returns
Value in nanoseconds.

◆ GetTime()

long com.dxfeed.util.TimePeriod.GetTime ( )
inline

Returns value in milliseconds.

Returns
Value in milliseconds.

◆ ValueOf() [1/2]

static TimePeriod com.dxfeed.util.TimePeriod.ValueOf ( long  value)
inlinestatic

Returns TimePeriod with value milliseconds.

Parameters
valueValue in milliseconds.
Returns
TimePeriod with value milliseconds.

◆ ValueOf() [2/2]

static TimePeriod com.dxfeed.util.TimePeriod.ValueOf ( string  value)
inlinestatic

Returns TimePeriod represented with a given string.

Allowable format is ISO8601 duration, but there are some simplifications and modifications available: Letters are case insensitive. Letters "P" and "T" can be omitted. Letter "S" can be also omitted. In this case last number will be supposed to be seconds. Number of seconds can be fractional. So it is possible to define duration accurate within milliseconds. Every part can be omitted. It is supposed that it's value is zero then.

Parameters
valueString representation.
Returns
TimePeriod represented with a given string.
Exceptions
FormatExceptionif cannot parse value.

Field Documentation

◆ ZERO

readonly TimePeriod com.dxfeed.util.TimePeriod.ZERO = new TimePeriod(0)
static

Time-period of zero.


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