com::ftlabs::fisa::calc::OneCashFlowCalculator Class Reference

#include <OneCashFlowCalculator.h>

Inheritance diagram for com::ftlabs::fisa::calc::OneCashFlowCalculator:

com::ftlabs::fisa::calc::AbstractCalculator com::ftlabs::fisa::calc::Calculator com::ftlabs::fisa::calc::YieldConvergable com::ftlabs::fisa::calc::DiscountCalculator com::ftlabs::fisa::calc::InterestAtMaturityCalculator com::ftlabs::fisa::calc::LastPeriodCalculator com::ftlabs::fisa::calc::ZeroCouponCalculator com::ftlabs::fisa::calc::CDLastPeriodCalculator com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator com::ftlabs::fisa::calc::LastPeriodSimpleInterestCalculator com::ftlabs::fisa::calc::MSRBOneLongPeriodCalculator com::ftlabs::fisa::calc::MSRBOneShortPeriodCalculator List of all members.

Public Member Functions

const FISADategetSettlementDate (void) const
 Get the settlement date to which this Calculator is bound.
const RedemptiongetRedemption (void) const
 Get the Redemption to which this Calculator is bound.
const FISADategetInterestAccrualDate (void) const
 Get the date on which interest begins to accrue for this settlement to redemption period.
int getCashFlowCount (void) const
 Get the number of cashflows within the bounding settlement to Redemption period.
double getTotalCashFlow (int cashFlowIndex) const
 Get the principal and interest to be paid for a particular cashflow, as specified by cashFlowIndex.
FISADate getCashFlowDate (int cashFlowIndex) const
 Get a cash flow date for a particular cashflow, as specified by the provided cashFlowIndex.
void getCashFlowDate (int cashFlowIndex, FISADate &date) const
 Set the provided FISADate to the cash flow date of a particular cashflow, as specified by the provided cashFlowIndex.
double calculatePeriodicYield (double price) const throw ( CalculationException )
 Calculate a periodic discounted cash flow yield for use with convexity/duration methods.
double calculateMacaulayDuration (double periodicYield) const throw ( CalculationException )
 Calculate the actual Macaulay duration.
double calculateModifiedDuration (double periodicYield) const throw ( CalculationException )
 Calculate the actual modified duration. If Macaulay Duration has already been or will be calculated, then it is more efficient to use the overloaded calculateModifiedDuration method that accepts the Macaulay Duration.
double calculateModifiedDuration (double macaulayDuration, double periodicYield) const throw ( CalculationException )
 Calculate the actual modified duration using an already calculated Macaulay Duration.
double calculateConvexity (double periodicYield) const throw ( CalculationException )
 Calculate the actual convexity.
virtual double calculateTrueYield (double price) const throw ( CalculationException )
 Calculate a True Yield, using adjusting cashflows that fall on business days.
virtual double calculateAccruedIncome (void) const throw ( CalculationException )
 Calculates the accrued interest income to Redemption.
virtual double calculateAccruedIncome (const FISADate &salesDate) const throw ( CalculationException )
 Calculates the accrued interest income to the supplied salesDate.
virtual double calculateInterestOnInterest (double reinvestmentYield) const throw ( CalculationException )
 Calculate the interest earned on reinvested interest cashflows using the provided reinvestmentYield.

Protected Member Functions

 OneCashFlowCalculator (void)
 OneCashFlowCalculator (const FISADate &settlementDate, const Redemption &redemption, double parValue, int interestFrequency)
 OneCashFlowCalculator (const OneCashFlowCalculator &calculator)
OneCashFlowCalculatoroperator= (const OneCashFlowCalculator &calculator)
virtual ~OneCashFlowCalculator (void)
void setValues (const FISADate &settlementDate, const Redemption &redemption, double parValue, int interestFrequency)

Protected Attributes

FISADate settlementDate
Redemption redemption
double parValue
int interestFrequency

Constructor & Destructor Documentation

com::ftlabs::fisa::calc::OneCashFlowCalculator::OneCashFlowCalculator ( void   )  [protected]

com::ftlabs::fisa::calc::OneCashFlowCalculator::OneCashFlowCalculator ( const FISADate settlementDate,
const Redemption redemption,
double  parValue,
int  interestFrequency 
) [protected]

com::ftlabs::fisa::calc::OneCashFlowCalculator::OneCashFlowCalculator ( const OneCashFlowCalculator calculator  )  [protected]

virtual com::ftlabs::fisa::calc::OneCashFlowCalculator::~OneCashFlowCalculator ( void   )  [protected, virtual]


Member Function Documentation

OneCashFlowCalculator& com::ftlabs::fisa::calc::OneCashFlowCalculator::operator= ( const OneCashFlowCalculator calculator  )  [protected]

void com::ftlabs::fisa::calc::OneCashFlowCalculator::setValues ( const FISADate settlementDate,
const Redemption redemption,
double  parValue,
int  interestFrequency 
) [protected]

const FISADate& com::ftlabs::fisa::calc::OneCashFlowCalculator::getSettlementDate ( void   )  const [virtual]

Get the settlement date to which this Calculator is bound.

Returns:
Settlement date.

Implements com::ftlabs::fisa::calc::Calculator.

const Redemption& com::ftlabs::fisa::calc::OneCashFlowCalculator::getRedemption ( void   )  const [virtual]

Get the Redemption to which this Calculator is bound.

Returns:
Redemption.

Implements com::ftlabs::fisa::calc::Calculator.

const FISADate* com::ftlabs::fisa::calc::OneCashFlowCalculator::getInterestAccrualDate ( void   )  const [virtual]

Get the date on which interest begins to accrue for this settlement to redemption period.

This method will return dated date if the settlement date is before the first interest date, the coupon date just prior to the settlement date, or the settlement date if it falls on a coupon payment date. This method may not be applicable to all implementations, in which case a 0 should be returned.

Returns:
The date on which interest begins to accrue.

Implements com::ftlabs::fisa::calc::Calculator.

Reimplemented in com::ftlabs::fisa::calc::LastPeriodCalculator.

int com::ftlabs::fisa::calc::OneCashFlowCalculator::getCashFlowCount ( void   )  const [virtual]

Get the number of cashflows within the bounding settlement to Redemption period.

Returns:
The number of cashflows within the supported settlement to Redemption period.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::getTotalCashFlow ( int  cashFlowIndex  )  const [virtual]

Get the principal and interest to be paid for a particular cashflow, as specified by cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.

Returns:
The principal + interest to be paid for the specified cashflow.

Implements com::ftlabs::fisa::calc::Calculator.

FISADate com::ftlabs::fisa::calc::OneCashFlowCalculator::getCashFlowDate ( int  cashFlowIndex  )  const [virtual]

Get a cash flow date for a particular cashflow, as specified by the provided cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.
Returns:
The cash flow date for the provided cash flow index.

Implements com::ftlabs::fisa::calc::Calculator.

void com::ftlabs::fisa::calc::OneCashFlowCalculator::getCashFlowDate ( int  cashFlowIndex,
FISADate date 
) const [virtual]

Set the provided FISADate to the cash flow date of a particular cashflow, as specified by the provided cashFlowIndex.

Parameters:
cashFlowIndex The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1.
date A reference to a FISADate to be set to the specified cash flow date.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculatePeriodicYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate a periodic discounted cash flow yield for use with convexity/duration methods.

Parameters:
price the price.
Returns:
Periodic discounted cash flow yield.

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateMacaulayDuration ( double  periodicYield  )  const throw ( CalculationException ) [virtual]

Calculate the actual Macaulay duration.

Parameters:
periodicYield The periodicYield as returned from the calculatePeriodicYield method.

Returns:
the Macaulay duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateModifiedDuration ( double  periodicYield  )  const throw ( CalculationException ) [virtual]

Calculate the actual modified duration. If Macaulay Duration has already been or will be calculated, then it is more efficient to use the overloaded calculateModifiedDuration method that accepts the Macaulay Duration.

Parameters:
periodicYield The periodicYield as returned from the calculatePeriodicYield method.

Returns:
the modified duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateModifiedDuration ( double  macaulayDuration,
double  periodicYield 
) const throw ( CalculationException ) [virtual]

Calculate the actual modified duration using an already calculated Macaulay Duration.

Parameters:
macaulayDuration The Macaulay Duration as calculated by the calculateMacaulayDuration method.
periodicYield The periodicYield as returned from the calculatePeriodicYield method.

Returns:
the modified duration.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateConvexity ( double  periodicYield  )  const throw ( CalculationException ) [virtual]

Calculate the actual convexity.

Parameters:
periodicYield The periodicYield as returned from the calculatePeriodicYield method.

Returns:
the convexity.

Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

virtual double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateTrueYield ( double  price  )  const throw ( CalculationException ) [virtual]

Calculate a True Yield, using adjusting cashflows that fall on business days.

Cashflow dates are adjusted according to a provided HolidaySchedule and/or weekend days.

Parameters:
price the clean price.
Returns:
The true yield using adjusted cashflows that fall on business days.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

Reimplemented in com::ftlabs::fisa::calc::CDLastPeriodCalculator, com::ftlabs::fisa::calc::DiscountCalculator, com::ftlabs::fisa::calc::InterestAtMaturityCalculator, com::ftlabs::fisa::calc::LastPeriodCompoundInterestCalculator, com::ftlabs::fisa::calc::LastPeriodSimpleInterestCalculator, and com::ftlabs::fisa::calc::ZeroCouponCalculator.

virtual double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateAccruedIncome ( void   )  const throw ( CalculationException ) [virtual]

Calculates the accrued interest income to Redemption.

Returns:
The accrued interest income to redemption.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

virtual double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateAccruedIncome ( const FISADate salesDate  )  const throw ( CalculationException ) [virtual]

Calculates the accrued interest income to the supplied salesDate.

Parameters:
salesDate The projected or actual sales date.
Returns:
The accrued interest income to the supplied salesDate.
Exceptions:
com::ftlabs::fisa::calc::CalculationException CalculationException

Implements com::ftlabs::fisa::calc::Calculator.

Reimplemented in com::ftlabs::fisa::calc::LastPeriodCalculator.

virtual double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateInterestOnInterest ( double  reinvestmentYield  )  const throw ( CalculationException ) [virtual]

Calculate the interest earned on reinvested interest cashflows using the provided reinvestmentYield.

Parameters:
reinvestmentYield The assumed yield of the reinvested interest cashflows.
Returns:
The interest earned on reinvested interest cashflows.

Implements com::ftlabs::fisa::calc::Calculator.


Member Data Documentation

FISADate com::ftlabs::fisa::calc::OneCashFlowCalculator::settlementDate [protected]

Redemption com::ftlabs::fisa::calc::OneCashFlowCalculator::redemption [protected]

double com::ftlabs::fisa::calc::OneCashFlowCalculator::parValue [protected]

int com::ftlabs::fisa::calc::OneCashFlowCalculator::interestFrequency [protected]


The documentation for this class was generated from the following file:
Generated on Tue Feb 5 03:50:38 2008 for FTLabs FISA (c++) by  doxygen 1.5.2