Calendar Class Reference

#include <ql/calendar.hpp>

Inheritance diagram for Calendar:

Inheritance graph
[legend]
List of all members.

Detailed Description

calendar class

This class provides methods for determining whether a date is a business day or a holiday for a given market, and for incrementing/decrementing a date of a given number of business days.

The Bridge pattern is used to provide the base behavior of the calendar, namely, to determine whether a date is a business day.


Public Member Functions

 Calendar ()
Calendar interface
std::string name () const
 Returns the name of the calendar.

bool isBusinessDay (const Date &d) const
bool isEndOfMonth (const Date &d) const
bool isHoliday (const Date &d) const
Date roll (const Date &, RollingConvention convention=Following, const Date &origin=Date()) const
Date advance (const Date &, int n, TimeUnit unit, RollingConvention convention=Following) const
Date advance (const Date &date, const Period &period, RollingConvention convention) const

Protected Member Functions

 Calendar (const Handle< CalendarImpl > &impl)

Related Functions

(Note that these are not member functions.)

bool operator== (const Calendar &, const Calendar &)
bool operator!= (const Calendar &, const Calendar &)


Constructor & Destructor Documentation

Calendar  ) 
 

This default constructor returns a calendar with a null implementation, which is therefore unusable except as a placeholder.

Calendar const Handle< CalendarImpl > &  impl  )  [protected]
 

This protected constructor will only be invoked by derived classes which define a given Calendar implementation


Member Function Documentation

std::string name  )  const
 

Returns the name of the calendar.

Warning:
This method is used for output and comparison between calendars. It is not meant to be used for writing switch-on-type code.

bool isBusinessDay const Date d  )  const
 

Returns true iff the date is a business day for the given market.

bool isEndOfMonth const Date d  )  const
 

Returns true iff the date is last business day for the month in given market.

bool isHoliday const Date d  )  const
 

Returns true iff the date is a holiday for the given market.

Date roll const Date ,
RollingConvention  convention = Following,
const Date origin = Date()
const
 

Returns the next business day on the given market with respect to the given date and convention.

Date advance const Date ,
int  n,
TimeUnit  unit,
RollingConvention  convention = Following
const
 

Advances the given date of the given number of business days and returns the result.

Note:
The input date is not modified.

Date advance const Date date,
const Period period,
RollingConvention  convention
const
 

Advances the given date as specified by the given period and returns the result.

Note:
The input date is not modified.


Friends And Related Function Documentation

bool operator== const Calendar ,
const Calendar
[related]
 

Returns true iff the two calendars belong to the same derived class.


QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen