com::ftlabs::fisa::FISADate Class Reference

This class represents a calendar date, and includes methods to determine synchronicity as well as methods required for certain day count methods. More...

#include <FISADate.h>

List of all members.

Public Member Functions

 FISADate (void)
 Initializes an empty date with zero for month, day and year.
 FISADate (time_t time)
 Create a new FISADate from the provided time_t value.
 FISADate (int integerDate)
 Create a new FISADate from the provided integer that represents the new date formated as YYYYMMDD.
 FISADate (int year, int month, int day)
 Initializes a FISADate with the given year, month, and day.
 FISADate (const FISADate &date)
 ~FISADate (void)
FISADateoperator= (const FISADate &date)
bool operator== (const FISADate &date) const
bool operator!= (const FISADate &date) const
bool operator< (const FISADate &date) const
bool operator> (const FISADate &date) const
bool operator<= (const FISADate &date) const
bool operator>= (const FISADate &date) const
time_t getTime (void) const
 Return a time_t value of this date.
void setTime (time_t time)
 Set this date to the provided time_t value.
void set (int year, int month, int day)
 Sets the year, month, and day of this FISADate.
void setFromInteger (int integerDate)
 Sets this FISADate to the date provided with an integer formatted as YYYYMMDD.
int getYear (void) const
 Get the year of this FISADate.
int getMonth (void) const
 Get the month of this FISADate.
int getDay (void) const
 Get the day of this FISADate.
int getBaseOffset (void) const
 Calculates the number of days since the base date 00/00/0000.
int getBaseOffsetNoLeap (void) const
 Calculates the number of days since the base date 00/00/0000, ignoring leap days.
int getAsInteger (void) const
 Returns an integer representing this date, formated as YYYYMMDD.
bool isInSync (const FISADate &date, int interestFrequency, bool eomAdjust) const
 This method tests whether this date is in sync with the provided date according to the provided interestFrequency and eomAdjust setting.
bool isEom (void) const
 Determines if this date is the end of a month.
bool isLeapYear (void) const
 Determines if the year of this date is a leap year.
bool isEmpty (void) const
 Determine if this date object contains a value.

Private Attributes

short year
char month
char day
time_t * time
int * baseOffset

Static Private Attributes

static const int DAYS_IN_MONTHS []


Detailed Description

This class represents a calendar date, and includes methods to determine synchronicity as well as methods required for certain day count methods.


Constructor & Destructor Documentation

com::ftlabs::fisa::FISADate::FISADate ( void   ) 

Initializes an empty date with zero for month, day and year.

com::ftlabs::fisa::FISADate::FISADate ( time_t  time  ) 

Create a new FISADate from the provided time_t value.

com::ftlabs::fisa::FISADate::FISADate ( int  integerDate  ) 

Create a new FISADate from the provided integer that represents the new date formated as YYYYMMDD.

FISADate::getAsIngeter() can be used to retrieve this date formated as YYYYMMDD.

Parameters:
integerDate An integer representing a date formated as YYYYMMDD.

com::ftlabs::fisa::FISADate::FISADate ( int  year,
int  month,
int  day 
)

Initializes a FISADate with the given year, month, and day.

Parameters:
year the calendar year.
month the calendar month (1-12).
day the calendar day.

com::ftlabs::fisa::FISADate::FISADate ( const FISADate date  ) 

com::ftlabs::fisa::FISADate::~FISADate ( void   ) 


Member Function Documentation

FISADate& com::ftlabs::fisa::FISADate::operator= ( const FISADate date  ) 

bool com::ftlabs::fisa::FISADate::operator== ( const FISADate date  )  const

bool com::ftlabs::fisa::FISADate::operator!= ( const FISADate date  )  const

bool com::ftlabs::fisa::FISADate::operator< ( const FISADate date  )  const

bool com::ftlabs::fisa::FISADate::operator> ( const FISADate date  )  const

bool com::ftlabs::fisa::FISADate::operator<= ( const FISADate date  )  const

bool com::ftlabs::fisa::FISADate::operator>= ( const FISADate date  )  const

time_t com::ftlabs::fisa::FISADate::getTime ( void   )  const

Return a time_t value of this date.

void com::ftlabs::fisa::FISADate::setTime ( time_t  time  ) 

Set this date to the provided time_t value.

Parameters:
time A time_t value to which this date will be set.

void com::ftlabs::fisa::FISADate::set ( int  year,
int  month,
int  day 
)

Sets the year, month, and day of this FISADate.

Parameters:
year the calendar year.
month the calendar month (1-12).
day the calendar day.

void com::ftlabs::fisa::FISADate::setFromInteger ( int  integerDate  ) 

Sets this FISADate to the date provided with an integer formatted as YYYYMMDD.

Parameters:
integerDate An integer representing a date formatted as YYYYMMDD.

int com::ftlabs::fisa::FISADate::getYear ( void   )  const

Get the year of this FISADate.

Returns:
the year of this FISADate.

int com::ftlabs::fisa::FISADate::getMonth ( void   )  const

Get the month of this FISADate.

Returns:
the month of this FISADate.

int com::ftlabs::fisa::FISADate::getDay ( void   )  const

Get the day of this FISADate.

Returns:
the day of this FISADate.

int com::ftlabs::fisa::FISADate::getBaseOffset ( void   )  const

Calculates the number of days since the base date 00/00/0000.

This method may be used by various day count methods.

Returns:
the number of days since the base date 00/00/0000.

int com::ftlabs::fisa::FISADate::getBaseOffsetNoLeap ( void   )  const

Calculates the number of days since the base date 00/00/0000, ignoring leap days.

This method may be used by various day count methods.

Returns:
the number of days since the base date 00/00/0000, ignoring leap days.

int com::ftlabs::fisa::FISADate::getAsInteger ( void   )  const

Returns an integer representing this date, formated as YYYYMMDD.

This is achieved using the following : ( year * 10000 ) + ( month * 100 ) + day.

Returns:
an integer representing this date.

bool com::ftlabs::fisa::FISADate::isInSync ( const FISADate date,
int  interestFrequency,
bool  eomAdjust 
) const

This method tests whether this date is in sync with the provided date according to the provided interestFrequency and eomAdjust setting.

Parameters:
date a date with which to compare synchronicity.
interestFrequency the interest frequency to use.
eomAdjust determines whether the end of month adjustment rule should be used.

Returns:
true if this date is in sync with the provided date, otherwise false.

bool com::ftlabs::fisa::FISADate::isEom ( void   )  const

Determines if this date is the end of a month.

Returns:
true if this date is the end of a month, otherwise false

bool com::ftlabs::fisa::FISADate::isLeapYear ( void   )  const

Determines if the year of this date is a leap year.

Returns:
true if the year of this date is a leap year, otherwise false

bool com::ftlabs::fisa::FISADate::isEmpty ( void   )  const

Determine if this date object contains a value.

Returns:
True if this date has been set, otherwise, false.


Member Data Documentation

const int com::ftlabs::fisa::FISADate::DAYS_IN_MONTHS[] [static, private]

short com::ftlabs::fisa::FISADate::year [private]

char com::ftlabs::fisa::FISADate::month [private]

char com::ftlabs::fisa::FISADate::day [private]

time_t* com::ftlabs::fisa::FISADate::time [private]

int* com::ftlabs::fisa::FISADate::baseOffset [private]


The documentation for this class was generated from the following file:
Generated on Tue Feb 5 03:50:26 2008 for FTLabs FISA (c++) by  doxygen 1.5.2