com::ftlabs::fisa::DefaultHolidaySchedule Class Reference

This is the default implementation of HolidaySchedule. For maximum efficiency, this implementation caches all provided holidays so that the isHoliday() method returns as quickly as possible. More...

#include <DefaultHolidaySchedule.h>

Inheritance diagram for com::ftlabs::fisa::DefaultHolidaySchedule:

com::ftlabs::fisa::HolidaySchedule List of all members.

Public Member Functions

 DefaultHolidaySchedule (void)
 Creates a new instance of DefaultHolidaySchedule without any holidays.
 DefaultHolidaySchedule (const char *filePath)
 Creates a new instance of DefaultHolidaySchedule populated with dates contained in the provided file.
 DefaultHolidaySchedule (std::istream &inputStream)
 Creates a new instance of DefaultHolidaySchedule populated with the dates provided by an InputStream.
 DefaultHolidaySchedule (const DefaultHolidaySchedule &holidaySchedule)
virtual ~DefaultHolidaySchedule (void)
DefaultHolidayScheduleoperator= (const DefaultHolidaySchedule &holidaySchedule)
bool isHoliday (const FISADate &date) const
 Determines if the provided date is a holiday.
void clear (void)
 Clear all holidays from this schedule.
void addHoliday (const FISADate &date)
 Add a holiday date to this schedule.
void loadHolidays (std::istream &inputStream)
 Adds dates provided by an InputStream to this DefaultHolidaySchedule.

Private Attributes

std::set< const FISADateholidays

Detailed Description

This is the default implementation of HolidaySchedule. For maximum efficiency, this implementation caches all provided holidays so that the isHoliday() method returns as quickly as possible.


Constructor & Destructor Documentation

com::ftlabs::fisa::DefaultHolidaySchedule::DefaultHolidaySchedule ( void   ) 

Creates a new instance of DefaultHolidaySchedule without any holidays.

The addHoliday(), or one of the load*() methods must be called to populate the schedule. Otherwise all calls to isHoliday() will return false.

com::ftlabs::fisa::DefaultHolidaySchedule::DefaultHolidaySchedule ( const char *  filePath  ) 

Creates a new instance of DefaultHolidaySchedule populated with dates contained in the provided file.

The dates in the file must be in the format of "m/d/yyyy", and must be delimited with a carriage return and/or a linefeed.

Parameters:
filePath The path to a file that contains the holiday dates.

com::ftlabs::fisa::DefaultHolidaySchedule::DefaultHolidaySchedule ( std::istream &  inputStream  ) 

Creates a new instance of DefaultHolidaySchedule populated with the dates provided by an InputStream.

The dates in the stream must in the format of "m/d/yyyy", and must be delimited with a carriage return and/or a linefeed.

Parameters:
inputStream An InputStream that contains the holiday dates.

com::ftlabs::fisa::DefaultHolidaySchedule::DefaultHolidaySchedule ( const DefaultHolidaySchedule holidaySchedule  ) 

virtual com::ftlabs::fisa::DefaultHolidaySchedule::~DefaultHolidaySchedule ( void   )  [virtual]


Member Function Documentation

DefaultHolidaySchedule& com::ftlabs::fisa::DefaultHolidaySchedule::operator= ( const DefaultHolidaySchedule holidaySchedule  ) 

bool com::ftlabs::fisa::DefaultHolidaySchedule::isHoliday ( const FISADate date  )  const [virtual]

Determines if the provided date is a holiday.

Parameters:
date Any date.
Returns:
true if the provided date is a holiday, otherwise false.

Implements com::ftlabs::fisa::HolidaySchedule.

void com::ftlabs::fisa::DefaultHolidaySchedule::clear ( void   ) 

Clear all holidays from this schedule.

void com::ftlabs::fisa::DefaultHolidaySchedule::addHoliday ( const FISADate date  ) 

Add a holiday date to this schedule.

Parameters:
date A holiday date to be added to this schedule.

void com::ftlabs::fisa::DefaultHolidaySchedule::loadHolidays ( std::istream &  inputStream  ) 

Adds dates provided by an InputStream to this DefaultHolidaySchedule.

The dates in the stream must be in the format of "m/d/yyyy", and must be delimited with a carriage return and/or a linefeed.

Parameters:
inputStream An InputStream that contains the holiday dates.


Member Data Documentation

std::set<const FISADate> com::ftlabs::fisa::DefaultHolidaySchedule::holidays [private]


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