com.ftlabs.fisa
Class AbstractPreferredSecurity

java.lang.Object
  extended by com.ftlabs.fisa.AbstractSecurity
      extended by com.ftlabs.fisa.AbstractPreferredSecurity
All Implemented Interfaces:
Security, java.io.Serializable
Direct Known Subclasses:
PerpetualPreferredSecurity, PreferredSecurity

public abstract class AbstractPreferredSecurity
extends AbstractSecurity

Abstract Security implementation that includes call information and data required for preferred Securities.

See Also:
Serialized Form

Field Summary
protected  FISADate dividendPaymentDate
           
protected  FISADate exDividendDate
           
protected  InterestFrequency interestFrequency
           
protected  double interestRate
           
 
Constructor Summary
AbstractPreferredSecurity(Market market)
          Creates an AbstractCallableSecurity object of the given Market.
 
Method Summary
 Analytics calculate(AnalyticValueType givenType, double givenValue, FISADate settlementDate)
          A convenience method to calculate an Analytics object using the provided value and settlementDate to Maturity period.
 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 to maturity Redemption period.
 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 to maturity Redemption period.
 double calculateYield(double price, FISADate settlementDate, Redemption redemption)
          A convenience method to calculate the yield from the provided price and settlement to Redemption period.
 Calculator getCalculator(FISADate settlementDate, Redemption redemption)
          Get a Calculator for this Security and provided settlementDate to Redemption period.
 CallSchedule getCallSchedule()
          Get the CallSchedule for this Security.
 FISADate getDividendPaymentDate()
          Get the dividendPaymentDate.
 FISADate getExDividendDate()
          Get the exDividendDate.
 InterestFrequency getInterestFrequency()
          Get the InterestFrequency.
 double getInterestRate()
          Get the interest rate.
 java.util.Collection getRedemptions()
          Get a Collection of all Redemptions.
 void setCallSchedule(CallSchedule callSchedule)
          Set the CallSchedule for this Security.
 void setDividendPaymentDate(FISADate dividendPaymentDate)
          Set the dividendPaymentDate.
 void setExDividendDate(FISADate exDividendDate)
          Set the exDividendDate.
 void setInterestFrequency(InterestFrequency interestFrequency)
          Set the InterestFrequency.
 void setInterestRate(double interestRate)
          Set the interestRate rate.
 
Methods inherited from class com.ftlabs.fisa.AbstractSecurity
addSecurityInvalidationListener, getDatedDate, getDayCountBasis, getMarket, getParValue, invalidate, isEomAdjust, removeSecurityInvalidationListener, setDatedDate, setDayCountBasis, setEomAdjust, setParValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ftlabs.fisa.Security
createQuoteAnalytics, getCalculator
 

Field Detail

interestRate

protected double interestRate

interestFrequency

protected InterestFrequency interestFrequency

dividendPaymentDate

protected FISADate dividendPaymentDate

exDividendDate

protected FISADate exDividendDate
Constructor Detail

AbstractPreferredSecurity

public AbstractPreferredSecurity(Market market)
Creates an AbstractCallableSecurity object of the given Market.

Parameters:
market - required and immutable Market for this security. This constructor will throw a NullPointerException if Market is null.
Method Detail

getInterestRate

public double getInterestRate()
Get the interest rate.

Returns:
interest rate.

setInterestRate

public void setInterestRate(double interestRate)
Set the interestRate rate.

Parameters:
interestRate - rate.

getInterestFrequency

public InterestFrequency getInterestFrequency()
Get the InterestFrequency.

Returns:
InterestFrequency.

setInterestFrequency

public void setInterestFrequency(InterestFrequency interestFrequency)
Set the InterestFrequency.

Parameters:
interestFrequency - the InterestFrequency

getDividendPaymentDate

public FISADate getDividendPaymentDate()
Get the dividendPaymentDate.

Returns:
the dividendPaymentDate.

setDividendPaymentDate

public void setDividendPaymentDate(FISADate dividendPaymentDate)
Set the dividendPaymentDate.

Parameters:
dividendPaymentDate -

getExDividendDate

public FISADate getExDividendDate()
Get the exDividendDate.

Returns:
the exDividendDate.

setExDividendDate

public void setExDividendDate(FISADate exDividendDate)
Set the exDividendDate.

Parameters:
exDividendDate -

setCallSchedule

public void setCallSchedule(CallSchedule callSchedule)
Set the CallSchedule for this Security.

Parameters:
callSchedule -

getCallSchedule

public CallSchedule getCallSchedule()
Get the CallSchedule for this Security.

Returns:
the CallSchedule for this Security.

calculatePrice

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

Parameters:
yield - The yield.
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

public 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.
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

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

Parameters:
price - The price.
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

public 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.
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

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

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

public 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

public 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

getCalculator

public Calculator getCalculator(FISADate settlementDate,
                                Redemption redemption)
                         throws CalculationException
Get a Calculator for this Security and provided settlementDate to Redemption period. Settlement will be used as tradeDate.

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 for this Security and provided settlementDate to Redemption period.
Throws:
com.ftlabs.fis.calc.CalculationException
CalculationException

getRedemptions

public java.util.Collection getRedemptions()
Get a Collection of all Redemptions.

Returns:
a Collection of all Redemptions.