com.ftlabs.fisa
Class Market

java.lang.Object
  extended by com.ftlabs.fisa.Market
All Implemented Interfaces:
java.io.Serializable

public class Market
extends java.lang.Object
implements java.io.Serializable

This class identifies the Market of a given Security and provides market default settings and market specific calculation methods.

To get an instance of Market, you can either use the static public country collections such as Market.US.CORPORATE, or the static public getByName() method such as Market.getByName( "US/Corporate" );

See Also:
Serialized Form

Nested Class Summary
static class Market.US
          Static Collection of all supported US markets.
 
Method Summary
static Market getByName(java.lang.String name)
          Get a Market for the given name.
 DayCountBasis getDefaultDayCountBasis()
          Retrieve the default DayCountBasis.
 DayCountBasis getDefaultDayCountBasis(java.lang.Class<? extends Security> securityClass)
          Retrieve the default DayCountBasis for the provided Security class within this Market.
 boolean getDefaultEomAdjust()
          Retrieve the default End Of Month Adjustment setting.
 boolean getDefaultEomAdjust(java.lang.Class<? extends Security> securityClass)
          Retrieve the default End Of Month Adjustment setting for the provided Security class within this Market.
 InterestFrequency getDefaultInterestFrequency()
          Retrieve the default InterestFrequency.
 InterestFrequency getDefaultInterestFrequency(java.lang.Class<? extends Security> securityClass)
          Retrieve the default InterestFrequency for the provided Security class within this Market.
 int getDefaultSettlementDays()
          Retrieve the default Number of days to settle.
 int getDefaultSettlementDays(java.lang.Class<? extends Security> securityClass)
          Retrieve the default Number of days to settle for the provided Security class within this Market.
static java.util.Collection<Market> getSupportedMarkets()
          A static method that returns a sorted Collection of all supported markets.
 double prepareAIForDisplay(double accruedInterest)
          Prepare an accrued interest value for display according to market specific rules.
 double preparePriceForDisplay(double price)
          Prepare a price value for display according to market specific rules.
 double prepareYieldForDisplay(double yield)
          Prepare a yield value for display according to market specific rules.
 void setDefaultDayCountBasis(java.lang.Class<? extends Security> securityClass, DayCountBasis dayCountBasis)
          Change the default DayCountBasis for the provided Security class within this Market.
 void setDefaultDayCountBasis(DayCountBasis dayCountBasis)
          Change the default DayCountBasis for the this Market.
 void setDefaultEomAdjust(boolean eomAdjust)
          Change the default End Of Month Adjustment setting for the this Market.
 void setDefaultEomAdjust(java.lang.Class<? extends Security> securityClass, boolean eomAdjust)
          Change the default End of Month Admustment setting for the provided Security class within this Market.
 void setDefaultInterestFrequency(java.lang.Class<? extends Security> securityClass, InterestFrequency interestFrequency)
          Change the default InterestFrequency for the provided Security class within this Market.
 void setDefaultInterestFrequency(InterestFrequency interestFrequency)
          Change the default InterestFrequency for the this Market.
 void setDefaultSettlementDays(java.lang.Class<? extends Security> securityClass, int settlementDays)
          Change the default days to settlement.
 void setDefaultSettlementDays(int settlementDays)
          Change the default days to settlement.
 java.lang.String toString()
          Returns the Market name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setDefaultDayCountBasis

public void setDefaultDayCountBasis(DayCountBasis dayCountBasis)
Change the default DayCountBasis for the this Market.

Parameters:
dayCountBasis - new default DayCountBasis.

setDefaultDayCountBasis

public void setDefaultDayCountBasis(java.lang.Class<? extends Security> securityClass,
                                    DayCountBasis dayCountBasis)
Change the default DayCountBasis for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
dayCountBasis - the new default DayCountBasis.

getDefaultDayCountBasis

public DayCountBasis getDefaultDayCountBasis()
Retrieve the default DayCountBasis.

Returns:
the default DayCountBasis.

getDefaultDayCountBasis

public DayCountBasis getDefaultDayCountBasis(java.lang.Class<? extends Security> securityClass)
Retrieve the default DayCountBasis for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
Returns:
the default DayCountBasis for the provided Security class within this Market.

setDefaultInterestFrequency

public void setDefaultInterestFrequency(InterestFrequency interestFrequency)
Change the default InterestFrequency for the this Market.

Parameters:
interestFrequency - new InterestFrequency.

setDefaultInterestFrequency

public void setDefaultInterestFrequency(java.lang.Class<? extends Security> securityClass,
                                        InterestFrequency interestFrequency)
Change the default InterestFrequency for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
interestFrequency - new InterestFrequency.

getDefaultInterestFrequency

public InterestFrequency getDefaultInterestFrequency()
Retrieve the default InterestFrequency.

Returns:
the default InterestFrequency.

getDefaultInterestFrequency

public InterestFrequency getDefaultInterestFrequency(java.lang.Class<? extends Security> securityClass)
Retrieve the default InterestFrequency for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
Returns:
the default InterestFreqeucny for the provided Security class within this Market.

setDefaultEomAdjust

public void setDefaultEomAdjust(boolean eomAdjust)
Change the default End Of Month Adjustment setting for the this Market.

Parameters:
eomAdjust - new default End Of Month Adjustment setting.

setDefaultEomAdjust

public void setDefaultEomAdjust(java.lang.Class<? extends Security> securityClass,
                                boolean eomAdjust)
Change the default End of Month Admustment setting for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
eomAdjust - the new default End Of Month Adjustment setting.

getDefaultEomAdjust

public boolean getDefaultEomAdjust()
Retrieve the default End Of Month Adjustment setting.

Returns:
the default End Of Month Adjustment setting

getDefaultEomAdjust

public boolean getDefaultEomAdjust(java.lang.Class<? extends Security> securityClass)
Retrieve the default End Of Month Adjustment setting for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
Returns:
the default End Of Month Adjustment setting for the provided Security class within this Market.

getDefaultSettlementDays

public int getDefaultSettlementDays()
Retrieve the default Number of days to settle.

Returns:
the default Number of days to settle

getDefaultSettlementDays

public int getDefaultSettlementDays(java.lang.Class<? extends Security> securityClass)
Retrieve the default Number of days to settle for the provided Security class within this Market.

Parameters:
securityClass - A Security implementation Class.
Returns:
the default Number of days to settle for the provided Security class within this Market.

setDefaultSettlementDays

public void setDefaultSettlementDays(int settlementDays)
Change the default days to settlement.

Parameters:
settlementDays - new default days to settlement.

setDefaultSettlementDays

public void setDefaultSettlementDays(java.lang.Class<? extends Security> securityClass,
                                     int settlementDays)
Change the default days to settlement.

Parameters:
securityClass - A Security implementation Class.
settlementDays - new default days to settlement.

preparePriceForDisplay

public double preparePriceForDisplay(double price)
Prepare a price value for display according to market specific rules.

Parameters:
price - The calculated price.
Returns:
A price that has been prepared for display according to market specific rules.

prepareYieldForDisplay

public double prepareYieldForDisplay(double yield)
Prepare a yield value for display according to market specific rules.

Parameters:
yield - The calculated yield.
Returns:
A yield that has been prepared for display according to market specific rules.

prepareAIForDisplay

public double prepareAIForDisplay(double accruedInterest)
Prepare an accrued interest value for display according to market specific rules.

Parameters:
accruedInterest - The calculated accruedInterest.
Returns:
An accrued interest that has been prepared for display according to market specific rules.

toString

public java.lang.String toString()
Returns the Market name.

Overrides:
toString in class java.lang.Object
Returns:
The Market name.

getSupportedMarkets

public static java.util.Collection<Market> getSupportedMarkets()
A static method that returns a sorted Collection of all supported markets.

Returns:
a sorted Collection of all supported Markets.

getByName

public static Market getByName(java.lang.String name)
Get a Market for the given name. Market names begin with the country code, followed by the market, such as "US/Treasury".

Parameters:
name - The name of the Market to retrieve.
Returns:
A Market for the given name.