Class implements builder design pattern supporting construction of bonds. More...
#include <bondBuilder.hpp>
Public Member Functions | |
BuildBond () | |
default constructor More... | |
BuildBond & | withNotional (const double &) |
sets notional More... | |
BuildBond & | usingCalendar (const Calendar &) |
sets calendar More... | |
BuildBond & | withStartDate (const Date &) |
sets start date More... | |
BuildBond & | withCommenceOfTradingDate (const Date &) |
sets commence of trading date More... | |
BuildBond & | withMaturityDate (const Date &) |
sets maturity date More... | |
BuildBond & | withTenor (const Tenor &) |
sets maturity More... | |
BuildBond & | withFrequencyOfPayment (const Frequency &) |
sets frequency of payment More... | |
BuildBond & | withCoupon (const double &) |
sets bond coupon More... | |
BuildBond & | withMargin (const double &) |
sets bond margin More... | |
BuildBond & | withFaceValue (const double &) |
sets face value for zero-coupon bond More... | |
BuildBond & | withInterestRate (const InterestRate &) |
sets interest rate convention More... | |
operator FixedIncomeBond () | |
builds FixedIncomeBond on the basis of provided inputs. More... | |
operator FloatingRateBond () | |
builds FixedIncomeBond on the basis of provided inputs. More... | |
operator ZeroCouponBond () | |
builds ZeroCouponBond on the basis of provided inputs. More... | |
Private Member Functions | |
void | reset () |
resets inputs to default values More... | |
void | datesCalculation () |
calculates More... | |
Private Attributes | |
double | notional_ |
Notional of the bond. More... | |
double | coupon_ |
Coupon paid by bond. More... | |
double | margin_ |
Margin of floating rate bond. More... | |
double | face_amount_ |
Face amount of Zero coupon bond. More... | |
Calendar | calendar_ |
Calendar used to construct the bond. More... | |
Date | start_date_ |
Date from which bond starts to accrue value. More... | |
Date | commence_of_trading_date_ |
Bond issue date. More... | |
Date | maturity_date_ |
Calendar used by a curve. More... | |
Tenor | maturity_ |
Maturity of the bond. More... | |
InterestRate | rate_ |
Interest rate convention. More... | |
Frequency | payment_frequency_ |
Frequency of payment. More... | |
Detailed Description
Class implements builder design pattern supporting construction of bonds.
The builder class is an implementation of creational design pattern called Builder. The aim of creating this class was to provide robust, readable and flexible method of constructing object representing bonds.
The class contains setting methods that provides inputs to the construction process, and casting operator that transform builder into required bond.
Trade date must be provided. Other dates of the contract may not be defined if the calendar and adequate tenors are given. If notional is not provided it is set to 100.0.
- Examples:
- bondsExample.cpp.
Constructor & Destructor Documentation
julian::BuildBond::BuildBond | ( | ) |
default constructor
Member Function Documentation
|
private |
calculates
julian::BuildBond::operator FixedIncomeBond | ( | ) |
builds FixedIncomeBond on the basis of provided inputs.
julian::BuildBond::operator FloatingRateBond | ( | ) |
builds FixedIncomeBond on the basis of provided inputs.
julian::BuildBond::operator ZeroCouponBond | ( | ) |
builds ZeroCouponBond on the basis of provided inputs.
|
private |
resets inputs to default values
- Notional is set to 100.0.
- Coupon is set to 0.0
- Remarks
- method used in constructor so keep it non-virtual
sets calendar
- Examples:
- bondsExample.cpp.
sets commence of trading date
BuildBond & julian::BuildBond::withCoupon | ( | const double & | input | ) |
sets bond coupon
- Examples:
- bondsExample.cpp.
BuildBond & julian::BuildBond::withFaceValue | ( | const double & | input | ) |
sets face value for zero-coupon bond
- Examples:
- bondsExample.cpp.
sets frequency of payment
- Examples:
- bondsExample.cpp.
BuildBond & julian::BuildBond::withInterestRate | ( | const InterestRate & | input | ) |
sets interest rate convention
- Examples:
- bondsExample.cpp.
BuildBond & julian::BuildBond::withMargin | ( | const double & | input | ) |
sets bond margin
- Examples:
- bondsExample.cpp.
sets maturity date
- Examples:
- bondsExample.cpp.
BuildBond & julian::BuildBond::withNotional | ( | const double & | input | ) |
sets notional
- Examples:
- bondsExample.cpp.
sets start date
- Examples:
- bondsExample.cpp.
sets maturity
- Examples:
- bondsExample.cpp.
Member Data Documentation
|
private |
Coupon paid by bond.
|
private |
Face amount of Zero coupon bond.
|
private |
Margin of floating rate bond.
|
private |
Maturity of the bond.
|
private |
Notional of the bond.
|
private |
Frequency of payment.
|
private |
Interest rate convention.
The documentation for this class was generated from the following files:
- C:/Unix/home/OEM/jULIAN/src/instruments/bonds/bondBuilder.hpp
- C:/Unix/home/OEM/jULIAN/src/instruments/bonds/bondBuilder.cpp