Class implements builder design pattern supporting construction of calendars. More...
#include <calendarBuilder.hpp>
Public Member Functions | |
BuildCalendar () | |
Constructor. More... | |
BuildCalendar & | withConvention (const DayRollingConvention &convention) |
Set convention. More... | |
BuildCalendar & | withSpotLag (const int spot_lag) |
Set spot lag. More... | |
BuildCalendar & | addHoliday (const Date &holiday) |
Marking day as holiday. More... | |
BuildCalendar & | addHoliday (const NameOfMonth month, const int day) |
Set holiday. More... | |
BuildCalendar & | addHoliday (const SmartPointer< Holiday > &holidays) |
Set holiday. More... | |
BuildCalendar & | removeHoliday (const Date &business_day) |
Marking day as business day. More... | |
BuildCalendar & | endOfMonth () |
End of month. More... | |
BuildCalendar & | withSettlementDateConvention (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< Date > | business_days_vector_ |
working days More... | |
std::vector< Date > | holidays_vector_ |
holidays as dates More... | |
std::vector< SmartPointer< Holiday > > | holidays_ |
predefined holidays More... | |
SmartPointer< SettlementDateConvention > | settlement_ |
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.
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
-
holiday The date which should be considered by generated calendar as holiday.
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
-
month The month of holiday. day The day of holiday.
BuildCalendar & julian::BuildCalendar::addHoliday | ( | const SmartPointer< Holiday > & | holiday | ) |
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_day The 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
-
convention Calendar with this convention will be generated.
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 | ) |
Set spot lag.
Method sets the value of the spot lag.
- Parameters
-
spot_lag Value of the spot lag which will be set in the calendar.
Member Data Documentation
|
private |
working days
Vector of dates which should be considered as business days - set created by removeHoliday method
|
private |
day rolling
Day rolling convention provided by method withConvention
|
private |
end of month convention
Boolean value that if it is true the calendar will adjust date according to end of month convention
|
private |
predefined holidays
Vector of predefined holidays - set created by addHoliday method
|
private |
holidays as dates
Vector of dates which should be considered as holidays days - set created by addHoliday method
|
private |
settlement date convention
Object implementing settlement date convention.
|
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