#include <OneCashFlowCalculator.h>
Inheritance diagram for com::ftlabs::fisa::calc::OneCashFlowCalculator:

Public Member Functions | |
| const FISADate & | getSettlementDate (void) const |
| Get the settlement date to which this Calculator is bound. | |
| const Redemption & | getRedemption (void) const |
| Get the Redemption to which this Calculator is bound. | |
| const FISADate * | getInterestAccrualDate (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) | |
| OneCashFlowCalculator & | operator= (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 |
| 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] |
| 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.
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.
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.
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.
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.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
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.
| cashFlowIndex | The cashflow index. cashFlowIndex is zero based and must be a number from 0 to getCashFlowCount() - 1. |
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.
| 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.
| price | the price. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateMacaulayDuration | ( | double | periodicYield | ) | const throw ( CalculationException ) [virtual] |
Calculate the actual Macaulay duration.
| periodicYield | The periodicYield as returned from the calculatePeriodicYield method. |
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.
| periodicYield | The periodicYield as returned from the calculatePeriodicYield method. |
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.
| macaulayDuration | The Macaulay Duration as calculated by the calculateMacaulayDuration method. | |
| periodicYield | The periodicYield as returned from the calculatePeriodicYield method. |
Implements com::ftlabs::fisa::calc::Calculator.
| double com::ftlabs::fisa::calc::OneCashFlowCalculator::calculateConvexity | ( | double | periodicYield | ) | const throw ( CalculationException ) [virtual] |
Calculate the actual convexity.
| periodicYield | The periodicYield as returned from the calculatePeriodicYield method. |
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.
| price | the clean price. |
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.
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.
| salesDate | The projected or actual sales date. |
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.
| reinvestmentYield | The assumed yield of the reinvested interest cashflows. |
Implements com::ftlabs::fisa::calc::Calculator.
double com::ftlabs::fisa::calc::OneCashFlowCalculator::parValue [protected] |
1.5.2