com::ftlabs::fisa::DiscreteInterestRateSchedule Class Reference

An InterestRateSchedule implementation that accepts discrete conversion dates and rates. More...

#include <DiscreteInterestRateSchedule.h>

Inheritance diagram for com::ftlabs::fisa::DiscreteInterestRateSchedule:

com::ftlabs::fisa::InterestRateSchedule List of all members.

Public Member Functions

 DiscreteInterestRateSchedule (void)
 DiscreteInterestRateSchedule (double firstInterestRate, const FISADate &conversionDate, double newInterestRate)
 A convenience constructor to create a DiscreteInterestRateSchedule with an initial interest rate and a single step.
 ~DiscreteInterestRateSchedule (void)
DiscreteInterestRateScheduleoperator= (const DiscreteInterestRateSchedule &schedule)
void setSingleStep (double firstInterestRate, const FISADate &conversionDate, double newInterestRate)
 A convenience method to clear this schedule and set an initial interest rate with a single step.
void add (const FISADate &conversionDate, double interestRate)
 Adds a new InterestRateStep to this DiscreteInterestRateSchedule, created using the provided date and interestRate.
void clear (void)
 Clears this DiscreteInterestRateSchedule.
int getIndex (const FISADate &date) const
 Get the index of the given date.
double getInterestRate (const FISADate &date) const
 Get the interest rate that would be applicable for the given date.
int getCount () const
 Get the total number of interest rates in this schedule.
const FISADate getDate (int index) const
 Get the conversionDate for the specified index.
void getDate (int index, FISADate &date) const
 Get the conversionDate for the specified index.
double getInterestRate (int index) const
 Get the interest reate for the specified index.

Private Member Functions

void sort (void) const

Private Attributes

std::vector< InterestRateStep > * steps
bool * needsSort

Detailed Description

An InterestRateSchedule implementation that accepts discrete conversion dates and rates.

The order in which the steps are added doesn't matter.


Constructor & Destructor Documentation

com::ftlabs::fisa::DiscreteInterestRateSchedule::DiscreteInterestRateSchedule ( void   ) 

com::ftlabs::fisa::DiscreteInterestRateSchedule::DiscreteInterestRateSchedule ( double  firstInterestRate,
const FISADate conversionDate,
double  newInterestRate 
)

A convenience constructor to create a DiscreteInterestRateSchedule with an initial interest rate and a single step.

Parameters:
firstInterestRate the interestRate to use from settlementDate until the conversionDate.
conversionDate the date on which the newInterestRate takes effect.
newInterestRate the interest rate to be used from conversionDate to maturity.

com::ftlabs::fisa::DiscreteInterestRateSchedule::~DiscreteInterestRateSchedule ( void   ) 


Member Function Documentation

DiscreteInterestRateSchedule& com::ftlabs::fisa::DiscreteInterestRateSchedule::operator= ( const DiscreteInterestRateSchedule schedule  ) 

void com::ftlabs::fisa::DiscreteInterestRateSchedule::setSingleStep ( double  firstInterestRate,
const FISADate conversionDate,
double  newInterestRate 
)

A convenience method to clear this schedule and set an initial interest rate with a single step.

Parameters:
firstInterestRate the interestRate to use from settlementDate until the conversionDate.
conversionDate the date on which the newInterestRate takes effect.
newInterestRate the interest rate to be used from conversionDate to maturity.

void com::ftlabs::fisa::DiscreteInterestRateSchedule::add ( const FISADate conversionDate,
double  interestRate 
)

Adds a new InterestRateStep to this DiscreteInterestRateSchedule, created using the provided date and interestRate.

The order in which the steps are added does not matter.

Parameters:
date the date that the provided interestRate takes effect.
interestRate the new interestRate.

void com::ftlabs::fisa::DiscreteInterestRateSchedule::clear ( void   ) 

Clears this DiscreteInterestRateSchedule.

int com::ftlabs::fisa::DiscreteInterestRateSchedule::getIndex ( const FISADate date  )  const [virtual]

Get the index of the given date.

Parameters:
date a date
Returns:
The index of the given date, or -1 if the date isn't found within this schedule.

Implements com::ftlabs::fisa::InterestRateSchedule.

double com::ftlabs::fisa::DiscreteInterestRateSchedule::getInterestRate ( const FISADate date  )  const [virtual]

Get the interest rate that would be applicable for the given date.

Parameters:
date a date
Returns:
the interest rate that is applicable for the given date.

Implements com::ftlabs::fisa::InterestRateSchedule.

int com::ftlabs::fisa::DiscreteInterestRateSchedule::getCount (  )  const [virtual]

Get the total number of interest rates in this schedule.

Returns:
the totla number of interest rates in this schedule.

Implements com::ftlabs::fisa::InterestRateSchedule.

const FISADate com::ftlabs::fisa::DiscreteInterestRateSchedule::getDate ( int  index  )  const [virtual]

Get the conversionDate for the specified index.

Parameters:
index the interest rate index
Returns:
the conversionDate for the specified index.

Implements com::ftlabs::fisa::InterestRateSchedule.

void com::ftlabs::fisa::DiscreteInterestRateSchedule::getDate ( int  index,
FISADate date 
) const [virtual]

Get the conversionDate for the specified index.

Parameters:
index the interest rate index
Returns:
the conversionDate for the specified index.

Implements com::ftlabs::fisa::InterestRateSchedule.

double com::ftlabs::fisa::DiscreteInterestRateSchedule::getInterestRate ( int  index  )  const [virtual]

Get the interest reate for the specified index.

Parameters:
index the interest rate index
Returns:
the interest rate for the specified index.

Implements com::ftlabs::fisa::InterestRateSchedule.

void com::ftlabs::fisa::DiscreteInterestRateSchedule::sort ( void   )  const [private]


Member Data Documentation

std::vector<InterestRateStep>* com::ftlabs::fisa::DiscreteInterestRateSchedule::steps [private]

bool* com::ftlabs::fisa::DiscreteInterestRateSchedule::needsSort [private]


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