te::dt::OrdinalPeriod Class Reference

A class to represent ordinal time period. More...

#include <OrdinalPeriod.h>

Inheritance diagram for te::dt::OrdinalPeriod:
te::dt::DateTimePeriod te::dt::DateTime te::dt::AbstractData

Public Member Functions

AbstractDataclone () const
 It returns a clone of this object. More...
 
DateTimeType getDateTimeType () const
 It returns the subtype of the date and time type. More...
 
DateTimeInstantgetFinalInstant () const
 It gets the final date time instant. More...
 
Int64 getFinalTime () const
 It returns the final time instant. More...
 
DateTimeInstantgetInitialInstant () const
 It gets the initial date time instant. More...
 
Int64 getInitialTime () const
 It returns the inital time instant. More...
 
int getTypeCode () const
 It returns the data type code associated to date and time values: DATETIME_TYPE. More...
 
bool operator!= (const DateTime &rhs) const
 Operator !=. More...
 
bool operator< (const DateTime &rhs) const
 Operator <. More...
 
bool operator== (const DateTime &rhs) const
 Operator ==. More...
 
bool operator> (const DateTime &rhs) const
 Operator > More...
 
 OrdinalPeriod ()
 Empty constructor. More...
 
 OrdinalPeriod (Int64 it, Int64 ft)
 Constructor. More...
 
void setFinalInstant (Int64 ft)
 It sets the final time instant. More...
 
void setInitialInstant (Int64 it)
 It sets the inital time instant. More...
 
std::string toString () const
 It returns the time period in a textual format (initialTimeInstant-finalTimeinstant) More...
 

Protected Attributes

OrdinalInstant m_finalInstant
 The final time instant information. More...
 
OrdinalInstant m_initialInstant
 The initial time instant information. More...
 

Detailed Description

A class to represent ordinal time period.

A time period represented by two ordinal numbers: the first one to represent the inital time and the second one the final time. Examples: a time period whose initial time is the first epidemiological week and the final time is the fifht epidemiological week.

To understand the meaning of the ordinal numbers, a user has to use extra information, such as the temporal resolution and the starting time in the DateTimeProperty.

See also
DateTime

Definition at line 55 of file OrdinalPeriod.h.

Constructor & Destructor Documentation

te::dt::OrdinalPeriod::OrdinalPeriod ( )

Empty constructor.

te::dt::OrdinalPeriod::OrdinalPeriod ( Int64  it,
Int64  ft 
)

Constructor.

Parameters
itThe initial time instant.
ftThe final time instant.

Member Function Documentation

AbstractData* te::dt::OrdinalPeriod::clone ( ) const
virtual

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

DateTimeType te::dt::OrdinalPeriod::getDateTimeType ( ) const
inlinevirtual

It returns the subtype of the date and time type.

Returns
The subtype of the date and time type.

Implements te::dt::DateTime.

Definition at line 171 of file OrdinalPeriod.h.

References te::dt::ORDINAL_TIME_PERIOD.

DateTimeInstant* te::dt::OrdinalPeriod::getFinalInstant ( ) const
virtual

It gets the final date time instant.

Returns
The final time instant
Note
The caller will take the ownership of the returned pointer.

Implements te::dt::DateTimePeriod.

Int64 te::dt::OrdinalPeriod::getFinalTime ( ) const
inline

It returns the final time instant.

Returns
The final time instant.

Definition at line 82 of file OrdinalPeriod.h.

DateTimeInstant* te::dt::OrdinalPeriod::getInitialInstant ( ) const
virtual

It gets the initial date time instant.

Returns
The initial time instant
Note
The caller will take the ownership of the returned pointer.

Implements te::dt::DateTimePeriod.

Int64 te::dt::OrdinalPeriod::getInitialTime ( ) const
inline

It returns the inital time instant.

Returns
The initial time instant.

Definition at line 75 of file OrdinalPeriod.h.

int te::dt::DateTime::getTypeCode ( ) const
inlinevirtualinherited

It returns the data type code associated to date and time values: DATETIME_TYPE.

Returns
The data type code associated to the date and time values: DATETIME_TYPE.

Implements te::dt::AbstractData.

Definition at line 103 of file DateTime.h.

References te::dt::DATETIME_TYPE.

bool te::dt::OrdinalPeriod::operator!= ( const DateTime rhs) const
virtual

Operator !=.

Parameters
rhsThe time period to be compared.
Returns
It returns true if the two time periods are not equal. Otherwise, it returns false.

Implements te::dt::DateTime.

bool te::dt::OrdinalPeriod::operator< ( const DateTime rhs) const
virtual

Operator <.

Parameters
rhsThe right-hand-side time period to be compared.
Returns
It returns true if the right-hand-side time period is greater than the lefth side one. Otherwise, it returns false.

Implements te::dt::DateTime.

bool te::dt::OrdinalPeriod::operator== ( const DateTime rhs) const
virtual

Operator ==.

Parameters
rhsThe time period to be compared.
Returns
It returns true if the two time periods are equal. Otherwise, it returns false.

Implements te::dt::DateTime.

bool te::dt::OrdinalPeriod::operator> ( const DateTime rhs) const
virtual

Operator >

Parameters
rhsThe right-hand-side time period to be compared.
Returns
It returns true if the right-hand-side time period is less than the lefth side one. Otherwise, it returns false.

Implements te::dt::DateTime.

void te::dt::OrdinalPeriod::setFinalInstant ( Int64  ft)
inline

It sets the final time instant.

Parameters
ftThe final time instant.

Definition at line 114 of file OrdinalPeriod.h.

void te::dt::OrdinalPeriod::setInitialInstant ( Int64  it)
inline

It sets the inital time instant.

Parameters
itThe initial time instant.

Definition at line 107 of file OrdinalPeriod.h.

std::string te::dt::OrdinalPeriod::toString ( ) const
virtual

It returns the time period in a textual format (initialTimeInstant-finalTimeinstant)

Returns
The time period in a textual format (initialTimeInstant-finalTimeinstant)

Implements te::dt::AbstractData.

Member Data Documentation

OrdinalInstant te::dt::OrdinalPeriod::m_finalInstant
protected

The final time instant information.

Definition at line 176 of file OrdinalPeriod.h.

OrdinalInstant te::dt::OrdinalPeriod::m_initialInstant
protected

The initial time instant information.

Definition at line 175 of file OrdinalPeriod.h.


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