Class implements builder design pattern supporting construction of calendars. More...

#include <calendarBuilder.hpp>

Public Member Functions

 BuildCalendar ()
 Constructor. More...
 
BuildCalendarwithConvention (const DayRollingConvention &convention)
 Set convention. More...
 
BuildCalendarwithSpotLag (const int spot_lag)
 Set spot lag. More...
 
BuildCalendaraddHoliday (const Date &holiday)
 Marking day as holiday. More...
 
BuildCalendaraddHoliday (const NameOfMonth month, const int day)
 Set holiday. More...
 
BuildCalendaraddHoliday (const SmartPointer< Holiday > &holidays)
 Set holiday. More...
 
BuildCalendarremoveHoliday (const Date &business_day)
 Marking day as business day. More...
 
BuildCalendarendOfMonth ()
 End of month. More...
 
BuildCalendarwithSettlementDateConvention (SmartPointer< SettlementDateConvention >)
 sets settlement convention More...
 
 operator Calendar ()
 creates calendar More...
 

Private Attributes

DayRollingConvention convention_
 day rolling More...
 
int spot_lag_
 spot lag More...
 
bool end_of_month_
 end of month convention More...
 
std::vector< Datebusiness_days_vector_
 working days More...
 
std::vector< Dateholidays_vector_
 holidays as dates More...
 
std::vector< SmartPointer< Holiday > > holidays_
 predefined holidays More...
 
SmartPointer< SettlementDateConventionsettlement_
 settlement date convention More...
 

Detailed Description

Class implements builder design pattern supporting construction of calendars.

Class provides simple and clear interface for constructing the calendar. The class contains the methods through which the parameters of calendar are established. The user does not have to provide all required parameters. If some parameters are not given builder sets following default setting:

  • day rolling convention: Unadjusted,
  • spot lag: 0 days,
  • no end of month adjustment,
  • no holidays.
Examples:
algebraicBootstrapperExample.cpp, bondsExample.cpp, bootstrapperComparison.cpp, constrainedBootstrapperExample.cpp, DatesAndCalendarExample.cpp, DepositExample.cpp, optionPricingExample.cpp, rootFindingBootstrapperExample.cpp, and unconstrainedBootstrapperExample.cpp.

Constructor & Destructor Documentation

julian::BuildCalendar::BuildCalendar ( )

Constructor.

This is a constructor of the class. At initialization of the object following values are set:

  • day rolling convention: Unadjusted,
  • spot lag: 0 days,
  • no end of month adjustment.
  • settlement date calculated from spot (see SettlementFromSpot)

Member Function Documentation

BuildCalendar & julian::BuildCalendar::addHoliday ( const Date holiday)

Marking day as holiday.

Date provided with this method will be considered as holiday by generated calendar.

Parameters
holidayThe date which should be considered by generated calendar as holiday.
Examples:
algebraicBootstrapperExample.cpp, bondsExample.cpp, bootstrapperComparison.cpp, constrainedBootstrapperExample.cpp, DatesAndCalendarExample.cpp, DepositExample.cpp, optionPricingExample.cpp, rootFindingBootstrapperExample.cpp, and unconstrainedBootstrapperExample.cpp.
BuildCalendar & julian::BuildCalendar::addHoliday ( const NameOfMonth  month,
const int  day 
)

Set holiday.

This method sets the holiday on given day and month each year.

Parameters
monthThe month of holiday.
dayThe day of holiday.
BuildCalendar & julian::BuildCalendar::addHoliday ( const SmartPointer< Holiday > &  holiday)

Set holiday.

This method sets the predefined sets of holidays (see class Holiday).

Parameters
holidayThis is an object of Holiday class. Days recognized as holiday by provided class will be also recognized as holidays by calendar.
BuildCalendar & julian::BuildCalendar::endOfMonth ( )

End of month.

If this method is called, generated calendar will apply end month convention while calculating the settlement and expiry dates.

julian::BuildCalendar::operator Calendar ( )

creates calendar

This is conversion operator. It generates the calendar with settings provided by other methods.

BuildCalendar & julian::BuildCalendar::removeHoliday ( const Date business_day)

Marking day as business day.

Date provided with this method will be considered as business day by generated calendar.

Parameters
business_dayThe date which should be considered by generated calendar as business day.
BuildCalendar & julian::BuildCalendar::withConvention ( const DayRollingConvention convention)

Set convention.

Method sets the convention (DayRollingConvention)for which calendar will be generated.

Parameters
conventionCalendar with this convention will be generated.
Examples:
algebraicBootstrapperExample.cpp, bondsExample.cpp, bootstrapperComparison.cpp, constrainedBootstrapperExample.cpp, DatesAndCalendarExample.cpp, DepositExample.cpp, optionPricingExample.cpp, rootFindingBootstrapperExample.cpp, and unconstrainedBootstrapperExample.cpp.
BuildCalendar & julian::BuildCalendar::withSettlementDateConvention ( SmartPointer< SettlementDateConvention settlement)

sets settlement convention

This method sets the settlement convention for the calendar being build.

BuildCalendar & julian::BuildCalendar::withSpotLag ( const int  spot_lag)

Member Data Documentation

std::vector<Date> julian::BuildCalendar::business_days_vector_
private

working days

Vector of dates which should be considered as business days - set created by removeHoliday method

DayRollingConvention julian::BuildCalendar::convention_
private

day rolling

Day rolling convention provided by method withConvention

bool julian::BuildCalendar::end_of_month_
private

end of month convention

Boolean value that if it is true the calendar will adjust date according to end of month convention

std::vector<SmartPointer<Holiday> > julian::BuildCalendar::holidays_
private

predefined holidays

Vector of predefined holidays - set created by addHoliday method

std::vector<Date> julian::BuildCalendar::holidays_vector_
private

holidays as dates

Vector of dates which should be considered as holidays days - set created by addHoliday method

SmartPointer<SettlementDateConvention> julian::BuildCalendar::settlement_
private

settlement date convention

Object implementing settlement date convention.

int julian::BuildCalendar::spot_lag_
private

spot lag

Size of spot lag provided by method withSpotLag


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/dates/calendars/calendarBuilder.hpp
  • C:/Unix/home/OEM/jULIAN/src/dates/calendars/calendarBuilder.cpp