com.ftlabs.fisa.calc
Class YieldQuote

java.lang.Object
  extended by com.ftlabs.fisa.calc.YieldQuote
All Implemented Interfaces:
Quote, java.io.Serializable
Direct Known Subclasses:
SpreadQuote

public class YieldQuote
extends java.lang.Object
implements Quote

A yield based implementation of Quote.

See Also:
Serialized Form

Nested Class Summary
static class YieldQuote.RedemptionType
           
 
Constructor Summary
YieldQuote(double yield)
          Constructs a new YieldQuote from the given yield without a concession and priced to the lowest yield.
YieldQuote(double yield, double concession)
          Constructs a new YieldQuote from the given yield an concession priced to the lowest yield.
YieldQuote(double yield, double concession, Redemption redemption)
          Constructs a new YieldQuote using the given yield less concession, priced to the given Redemption.
YieldQuote(double yield, double concession, YieldQuote.RedemptionType redemptionType)
          Constructs a new YieldQuote using the given yield less concession priced to the given RedemptionType.
YieldQuote(double yield, Redemption redemption)
          Constructs a new YieldQuote from the given yield and Redemption without a concession.
YieldQuote(double yield, YieldQuote.RedemptionType redemptionType)
          Constructs a new YieldQuote from the given yield and RedemptionType without a concession.
 
Method Summary
 double getConcession()
          Get the concession.
 double getPrice(Calculator maturityCalculator, Calculator[] otherRedemptionCalculators)
          Returns a price.
 Redemption getRedemption()
          Get the specific Redemption if any, to which this quote is priced.
 YieldQuote.RedemptionType getRedemptionType()
          Get the RedemptionType if any.
 double getYield()
          Get the yield.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YieldQuote

public YieldQuote(double yield)
Constructs a new YieldQuote from the given yield without a concession and priced to the lowest yield.

Parameters:
yield - the yield.

YieldQuote

public YieldQuote(double yield,
                  YieldQuote.RedemptionType redemptionType)
Constructs a new YieldQuote from the given yield and RedemptionType without a concession.

Parameters:
yield - the yield.
redemptionType - the RedemptionType to which this quote is priced.

YieldQuote

public YieldQuote(double yield,
                  Redemption redemption)
Constructs a new YieldQuote from the given yield and Redemption without a concession.

Parameters:
yield - the yield.
redemption - the Redemption to which this quote is priced.

YieldQuote

public YieldQuote(double yield,
                  double concession)
Constructs a new YieldQuote from the given yield an concession priced to the lowest yield.

Parameters:
yield - the yield.
concession - the concession.

YieldQuote

public YieldQuote(double yield,
                  double concession,
                  YieldQuote.RedemptionType redemptionType)
Constructs a new YieldQuote using the given yield less concession priced to the given RedemptionType.

Parameters:
yield - the yield.
concession - the concession.
redemptionType - the RedemptionType to which this quote is priced.

YieldQuote

public YieldQuote(double yield,
                  double concession,
                  Redemption redemption)
Constructs a new YieldQuote using the given yield less concession, priced to the given Redemption.

Parameters:
yield - the yield.
concession - the concession.
redemption - the Redemption to which this quote is priced.
Method Detail

getYield

public double getYield()
Get the yield.

Returns:
the yield.

getConcession

public double getConcession()
Get the concession.

Returns:
the concession.

getRedemptionType

public YieldQuote.RedemptionType getRedemptionType()
Get the RedemptionType if any. This method may return null if a specific Redemption was used instead.

Returns:
the RedemptionType to which this quote is priced, or null.

getRedemption

public Redemption getRedemption()
Get the specific Redemption if any, to which this quote is priced. This method may return null if a RedemptionType was used instead.

Returns:
the specific Redemption to which this quote is priced, or null.

getPrice

public double getPrice(Calculator maturityCalculator,
                       Calculator[] otherRedemptionCalculators)
                throws CalculationException
Description copied from interface: Quote
Returns a price. This method would not normally be called directly by a user.

Specified by:
getPrice in interface Quote
Parameters:
maturityCalculator - A calculator bound to maturity.
otherRedemptionCalculators - An array of calculators bound to each of the calls.
Returns:
the price
Throws:
CalculationException