com.ftlabs.fisa
Class AbstractSecurity

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

public abstract class AbstractSecurity
extends java.lang.Object
implements Security

Abstract Security implementation with very minimum common fields.

See Also:
Serialized Form

Constructor Summary
AbstractSecurity(Market market)
          Creates an AbstractSecurity object of the given Market.
 
Method Summary
protected  void addSecurityInvalidationListener(SecurityInvalidationListener listener)
          Add a SecurityInvalidationListener.
 FISADate getDatedDate()
          Get method for property datedDate.
 DayCountBasis getDayCountBasis()
          Get method for property dayCountBasis.
 Market getMarket()
          Get method for property market.
 double getParValue()
          Get method for property parValue.
protected  void invalidate()
          This method is called to inform all interested listeners that this Security has been changed.
 boolean isEomAdjust()
          Get method for property eomAdjust.
protected  void removeSecurityInvalidationListener(SecurityInvalidationListener listener)
          Remove a SecurityInvalidationListener.
 void setDatedDate(FISADate datedDate)
          Set method for property datedDate.
 void setDayCountBasis(DayCountBasis dayCountBasis)
          Set the DayCountBasis to be used for calculating this Security.
 void setEomAdjust(boolean eomAdjust)
          Set whether or not the End Of Month Adjustment rule should be used when calculating this Security.
 void setParValue(double parValue)
          Set method for property parValue.
 
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
calculate, calculate, calculateAccruedInterest, calculatePrice, calculatePrice, calculateYield, calculateYield, createQuoteAnalytics, getCalculator, getCalculator, getRedemptions
 

Constructor Detail

AbstractSecurity

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

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

getMarket

public Market getMarket()
Get method for property market.

Specified by:
getMarket in interface Security
Returns:
Value of property market.

getDatedDate

public final FISADate getDatedDate()
Get method for property datedDate.

Returns:
Value of property datedDate.

setDatedDate

public final void setDatedDate(FISADate datedDate)
Set method for property datedDate.

Parameters:
datedDate - New value of property datedDate.

getParValue

public final double getParValue()
Get method for property parValue.

Returns:
Value of property parValue.

setParValue

public final void setParValue(double parValue)
Set method for property parValue.

Parameters:
parValue - New value of property parValue.

getDayCountBasis

public final DayCountBasis getDayCountBasis()
Get method for property dayCountBasis.

Returns:
the DayCountBasis for this Security. If a DayCountBasis has not been set for this Security then the default DayCountBasis for this Market will be returned.

setDayCountBasis

public final void setDayCountBasis(DayCountBasis dayCountBasis)
Set the DayCountBasis to be used for calculating this Security.

Parameters:
dayCountBasis - The DayCountBasis to be used for calculating this Security.

isEomAdjust

public final boolean isEomAdjust()
Get method for property eomAdjust.

Returns:
Whether or not the End Of Month Adjustment rule should be used when calculating this Security. If eomAdjust has not been set for this Security then the default eomAdjust value for this Market will be returned.

setEomAdjust

public final void setEomAdjust(boolean eomAdjust)
Set whether or not the End Of Month Adjustment rule should be used when calculating this Security.

Parameters:
eomAdjust - New value of property eomAdjust.

invalidate

protected void invalidate()
This method is called to inform all interested listeners that this Security has been changed.


addSecurityInvalidationListener

protected void addSecurityInvalidationListener(SecurityInvalidationListener listener)
Add a SecurityInvalidationListener. This is wrapped with a WeakReference, so it is important that a strong reference be kept to the passed listener.

Parameters:
listener - The SecurityInvalidationListener to be added.

removeSecurityInvalidationListener

protected void removeSecurityInvalidationListener(SecurityInvalidationListener listener)
Remove a SecurityInvalidationListener.

Parameters:
listener - The SecurityInvalidationListener to be removed.