ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Public Methods | Protected Fields | List of all members
TickSpan Class Reference

Class Description


This class splits a given Ticks object (representing a time span) into the amount of days, hours, minutes, seconds and so on. Consequently, it takes a Ticks object as a parameter. This class can be seen as an extension to the Ticks class which provides methods to get the total number of these values. In addition, the reverse calculation can be performed, which means, the field values can be set and the corresponding time span in ticks received.

Public Fields

int days
 The number of days within the time span.
 
int hours
 The number of hours (not the total, hence 0-23) within the time span.
 
int microseconds
 The number of microseconds (not the total, hence 0-999) within the time span.
 
int milliseconds
 The number of milliseconds (not the total, hence 0-999) within the time span.
 
int minutes
 The number of minutes (not the total, hence 0-59) within the time span.
 
int nanoseconds
 The number of nanoseconds (not the total, hence 0-999) within the time span.
 
int seconds
 The number of seconds (not the total, hence 0-59) within the time span.
 

Public Methods

 TickSpan ()
 
 TickSpan (long ticks)
 
 TickSpan (Ticks ticks)
 
void clear ()
 
long get ()
 
void set (long ticks)
 
void set (Ticks ticks)
 

Protected Fields

long ticks
 The time value received from the.
 

Constructor & Destructor Documentation

◆ TickSpan() [1/3]

TickSpan ( Ticks  ticks)

Constructs the object using the given Tick objects ticks value. After construction, the public fields are set properly

Parameters
ticksThe Ticks object to use for setting the public fields

◆ TickSpan() [2/3]

TickSpan ( long  ticks)

Constructs the object using the given ticks value. After construction, the public fields are set properly

Parameters
ticksThe value in ticks to use for setting the public fields

◆ TickSpan() [3/3]

TickSpan ( )

Constructs the object to represent a time span of 0. (Sets all public fields to 0.)

Member Function Documentation

◆ clear()

void clear ( )

Sets all public values to 0.

◆ get()

long get ( )

Takes the current values of the public fields and calculates a time span value in ticks. Such value can be used with class Ticks, e.g. to add or subtract time spans.

Returns
The time span represented by the current values of the public fields.

◆ set() [1/2]

void set ( long  ticks)

Sets the public fields to represent the given ticks value. The state of the object will hereafter be the same as it was when constructed with the same parameter.

Parameters
ticksThe value in ticks to use for setting the public fields

◆ set() [2/2]

void set ( Ticks  ticks)

Sets the public fields to represent the given Tick objects ticks value. The state of the object will hereafter be the same as it was when constructed with the same parameter.

Parameters
ticksThe Ticks object to use for setting the public fields

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