com.ftlabs.fisa
Interface Security

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractPreferredSecurity, AbstractSecurity, DiscountSecurity, FixedInterestRateSecurity, InflationIndexedSecurity, InterestAtMaturitySecurity, MaturingCallableSecurity, MaturingSecurity, PerpetualPreferredSecurity, PreferredSecurity, SteppedCouponSecurity, ZeroCouponSecurity

public interface Security
extends java.io.Serializable

This interface defines methods for retrieving Calculators for the implemented Security. It also defines some convenience calculation methods.

If more than one calculation must be run for a given settlement to Redemption period, then it is always more efficient to get a Calculator for that period and run the calculations from that Calculator.


Method Summary
 Analytics calculate(AnalyticValueType givenType, double givenValue, FISADate settlementDate)
          A convenience method to calculate an Analytics object using the provided value and settlementDate.
 Analytics calculate(AnalyticValueType givenType, double givenValue, FISADate settlementDate, Redemption redemption)
          A convenience method to calculate an Analytics object using the provided value and settlementDate to Redemption period.
 double calculateAccruedInterest(FISADate settlementDate)
          A convenience method to calculate the accrued interest for the provided settlementDate.
 double calculatePrice(double yield, FISADate settlementDate)
          A convenience method to calculate the price from the provided yield and settlementDate.
 double calculatePrice(double yield, FISADate settlementDate, Redemption redemption)
          A convenience method to calculate the price from the provided yield and settlement to Redemption period.
 double calculateYield(double price, FISADate settlementDate)
          A convenience method to calculate the yield from the provided price and settlementDate.
 double calculateYield(double price, FISADate settlementDate, Redemption redemption)
          A convenience method to calculate the yield from the provided price and settlement to Redemption period.
 QuoteAnalytics createQuoteAnalytics(Quote quote, FISADate settlementDate)
           
 Calculator getCalculator(FISADate settlementDate)
          Get a Calculator for this Security and provided settlementDate.
 Calculator getCalculator(FISADate settlementDate, Redemption redemption)
          Get a Calculator for this Security and provided settlementDate to Redemption period.
 Market getMarket()
          Get the Market for this Security.
 java.util.Collection getRedemptions()
          Get a Collection of all provided Redemptions for this Security.
 

Method Detail

getMarket

Market getMarket()
Get the Market for this Security.

Returns:
the Market for this Security.

getCalculator

Calculator getCalculator(FISADate settlementDate)
                         throws CalculationException
Get a Calculator for this Security and provided settlementDate. It is up to the implementation to determine which Redemption to use if any, although this will usually be to Maturity.

Parameters:
settlementDate - The binding settlementDate for which all calculations will be run.
Returns:
A Calculator for this Security and provided settlementDate.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

getCalculator

Calculator getCalculator(FISADate settlementDate,
                         Redemption redemption)
                         throws CalculationException
Get a Calculator for this Security and provided settlementDate to Redemption period.

Parameters:
settlementDate - The binding settlementDate for which all calculations will be run.
redemption - The binding Redemption to which all calculations will be run.
Returns:
A Calculator bound to this Security and provided settlementDate to Redemption period.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

createQuoteAnalytics

QuoteAnalytics createQuoteAnalytics(Quote quote,
                                    FISADate settlementDate)
                                    throws CalculationException
Throws:
CalculationException

calculatePrice

double calculatePrice(double yield,
                      FISADate settlementDate)
                      throws CalculationException
A convenience method to calculate the price from the provided yield and settlementDate. It is up to the implementation to determine which Redemption to use if any, although this will usually be Maturity.

Parameters:
yield - The yield from which to calculate a price.
settlementDate - The settlement date.
Returns:
The price of this Security for the provided yield and settlement date.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculatePrice

double calculatePrice(double yield,
                      FISADate settlementDate,
                      Redemption redemption)
                      throws CalculationException
A convenience method to calculate the price from the provided yield and settlement to Redemption period.

Parameters:
yield - The yield from which to calculate a price.
settlementDate - The settlement date for which this calculation is run.
redemption - The Redemption to which this calculation is run.
Returns:
The price of this Security for the provided yield and settlement to Redemption period.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculateYield

double calculateYield(double price,
                      FISADate settlementDate)
                      throws CalculationException
A convenience method to calculate the yield from the provided price and settlementDate. It is up to the implementation to determine which Redemption to use if any, although this will usually be Maturity.

Parameters:
price - The price from which to calculate a yield.
settlementDate - The settlement date.
Returns:
The price of this Security for the provided price and settlement date.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculateYield

double calculateYield(double price,
                      FISADate settlementDate,
                      Redemption redemption)
                      throws CalculationException
A convenience method to calculate the yield from the provided price and settlement to Redemption period.

Parameters:
price - The price from which to calculate a yield.
settlementDate - The settlement date for which this calculation is run.
redemption - The Redemption to which this calculation is run.
Returns:
The yield of this Security for the provided price and settlement to Redemption period.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculate

Analytics calculate(AnalyticValueType givenType,
                    double givenValue,
                    FISADate settlementDate)
                    throws CalculationException
A convenience method to calculate an Analytics object using the provided value and settlementDate. It is up to the implementation to determine which Redemption to use if any, although this will usually be Maturity.

Parameters:
givenType - The AnalyticValueType of the givenValue.
givenValue - The value to calculate the Analytics from.
settlementDate - The settlement date.
Returns:
The Analytics for this Security calcluated from the provided value and settlement date.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculate

Analytics calculate(AnalyticValueType givenType,
                    double givenValue,
                    FISADate settlementDate,
                    Redemption redemption)
                    throws CalculationException
A convenience method to calculate an Analytics object using the provided value and settlementDate to Redemption period.

Parameters:
givenType - The AnalyticValueType of the givenValue.
givenValue - The value to calculate the Analytics from.
settlementDate - The settlement date.
redemption - The Redemption.
Returns:
The Analytics for this Security calcluated from the provided value and settlementDate to Redemption period.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

calculateAccruedInterest

double calculateAccruedInterest(FISADate settlementDate)
                                throws CalculationException
A convenience method to calculate the accrued interest for the provided settlementDate.

Parameters:
settlementDate - The settlement date.
Returns:
The accrued interest of this Security for the provided settlement date.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

getRedemptions

java.util.Collection getRedemptions()
Get a Collection of all provided Redemptions for this Security. All Security implementations may not have any Redemptions. In this case this method will return null.

Returns:
A Collection of all provided Redemptions for this Security. If a Security doesn't support any Redemptions, such as a non callable perpetual, then this method will return null.