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

#include <bondBuilder.hpp>

Public Member Functions

 BuildBond ()
 default constructor More...
 
BuildBondwithNotional (const double &)
 sets notional More...
 
BuildBondusingCalendar (const Calendar &)
 sets calendar More...
 
BuildBondwithStartDate (const Date &)
 sets start date More...
 
BuildBondwithCommenceOfTradingDate (const Date &)
 sets commence of trading date More...
 
BuildBondwithMaturityDate (const Date &)
 sets maturity date More...
 
BuildBondwithTenor (const Tenor &)
 sets maturity More...
 
BuildBondwithFrequencyOfPayment (const Frequency &)
 sets frequency of payment More...
 
BuildBondwithCoupon (const double &)
 sets bond coupon More...
 
BuildBondwithMargin (const double &)
 sets bond margin More...
 
BuildBondwithFaceValue (const double &)
 sets face value for zero-coupon bond More...
 
BuildBondwithInterestRate (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

void julian::BuildBond::datesCalculation ( )
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.

void julian::BuildBond::reset ( )
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
BuildBond & julian::BuildBond::usingCalendar ( const Calendar input)

sets calendar

Examples:
bondsExample.cpp.
BuildBond & julian::BuildBond::withCommenceOfTradingDate ( const Date input)

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.
BuildBond & julian::BuildBond::withFrequencyOfPayment ( const Frequency input)

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.
BuildBond & julian::BuildBond::withMaturityDate ( const Date input)

sets maturity date

Examples:
bondsExample.cpp.
BuildBond & julian::BuildBond::withNotional ( const double &  input)

sets notional

Examples:
bondsExample.cpp.
BuildBond & julian::BuildBond::withStartDate ( const Date input)

sets start date

Examples:
bondsExample.cpp.
BuildBond & julian::BuildBond::withTenor ( const Tenor input)

sets maturity

Examples:
bondsExample.cpp.

Member Data Documentation

Calendar julian::BuildBond::calendar_
private

Calendar used to construct the bond.

Date julian::BuildBond::commence_of_trading_date_
private

Bond issue date.

double julian::BuildBond::coupon_
private

Coupon paid by bond.

double julian::BuildBond::face_amount_
private

Face amount of Zero coupon bond.

double julian::BuildBond::margin_
private

Margin of floating rate bond.

Tenor julian::BuildBond::maturity_
private

Maturity of the bond.

Date julian::BuildBond::maturity_date_
private

Calendar used by a curve.

double julian::BuildBond::notional_
private

Notional of the bond.

Frequency julian::BuildBond::payment_frequency_
private

Frequency of payment.

InterestRate julian::BuildBond::rate_
private

Interest rate convention.

Date julian::BuildBond::start_date_
private

Date from which bond starts to accrue value.


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