com.ftlabs.fisa
Class PreferredSecurity

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

public class PreferredSecurity
extends AbstractPreferredSecurity

An implementation of Security for Preferreds.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ftlabs.fisa.AbstractPreferredSecurity
dividendPaymentDate, exDividendDate, interestFrequency, interestRate
 
Constructor Summary
PreferredSecurity(Market market)
          Creates an PreferredSecurity object of the given Market.
 
Method Summary
 QuoteAnalytics createQuoteAnalytics(Quote quote, FISADate settlementDate)
           
 Calculator getCalculator(FISADate settlementDate)
          Get a Calculator for this Security and provided settlementDate.
 Calculator getCalculator(FISADate tradeDate, FISADate settlementDate)
          Get a Calculator for this Security and provided tradeDate and settlementDate.
 Calculator getCalculator(FISADate tradeDate, FISADate settlementDate, Redemption redemption)
          Get a Calculator for this PreferredSecurity and provided settlementDate to Redemption period using the overriding DayCountBasis.
 Redemption getMaturity()
          Get the maturity Redemption.
 FISADate getMaturityDate()
          A convenience method to get the current maturityDate.
 java.util.Collection getRedemptions()
          Get a Collection of all Redemptions.
 void setMaturity(FISADate maturityDate)
          Sets maturity to a new Redemption object for the given maturityDate with a default redemption value of 100.
 void setMaturity(FISADate maturityDate, double redemptionValue)
          Sets maturity to a new Redemption object for the given maturityDate and redemptionValue.
 void setMaturity(Redemption maturity)
          Set the maturity Redemption.
 
Methods inherited from class com.ftlabs.fisa.AbstractPreferredSecurity
calculate, calculate, calculateAccruedInterest, calculatePrice, calculatePrice, calculateYield, calculateYield, getCalculator, getCallSchedule, getDividendPaymentDate, getExDividendDate, getInterestFrequency, getInterestRate, setCallSchedule, setDividendPaymentDate, setExDividendDate, setInterestFrequency, setInterestRate
 
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
 

Constructor Detail

PreferredSecurity

public PreferredSecurity(Market market)
Creates an PreferredSecurity 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

getMaturity

public final Redemption getMaturity()
Get the maturity Redemption.

Returns:
The maturity Redemption.

getMaturityDate

public final FISADate getMaturityDate()
A convenience method to get the current maturityDate. This method returns getMaturity().getDate(), or null if getMaturity() is null.

Returns:
the current maturityDate, or null if it has not been set.

setMaturity

public final void setMaturity(Redemption maturity)
Set the maturity Redemption.

Parameters:
maturity - New maturity Redemption.

setMaturity

public final void setMaturity(FISADate maturityDate,
                              double redemptionValue)
Sets maturity to a new Redemption object for the given maturityDate and redemptionValue.

Parameters:
maturityDate - the date on which the security matures
redemptionValue - the redemption value at maturity

setMaturity

public final void setMaturity(FISADate maturityDate)
Sets maturity to a new Redemption object for the given maturityDate with a default redemption value of 100.

Parameters:
maturityDate - the date on which the security matures

getCalculator

public Calculator getCalculator(FISADate settlementDate)
                         throws CalculationException
Get a Calculator for this Security and provided settlementDate. Settlement date will be used as the trade date and maturity Redemption will be used as redemption.

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

getCalculator

public Calculator getCalculator(FISADate tradeDate,
                                FISADate settlementDate)
                         throws CalculationException
Get a Calculator for this Security and provided tradeDate and settlementDate. The maturity Redemption will be used with this settlementDate to create a new Calculator.

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

getCalculator

public Calculator getCalculator(FISADate tradeDate,
                                FISADate settlementDate,
                                Redemption redemption)
                         throws CalculationException
Get a Calculator for this PreferredSecurity and provided settlementDate to Redemption period using the overriding DayCountBasis.

Parameters:
tradeDate - The binding tradeDate for which all calculations will be run.
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

createQuoteAnalytics

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

getRedemptions

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

Specified by:
getRedemptions in interface Security
Overrides:
getRedemptions in class AbstractPreferredSecurity
Returns:
a Collection of all Redemptions.