- java.lang.Object
-
- net.finmath.modelling.UnsupportedProduct
-
- All Implemented Interfaces:
Serializable
,AnalyticProduct
,Product
public class UnsupportedProduct extends Object implements Product, AnalyticProduct, Serializable
A product throwing an exception if itsgetValue
method is called. This class can be used to created products trigger an exception only upon valuation (i.e., late).- Version:
- 1.0
- Author:
- Christian Fries
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UnsupportedProduct(Exception exception)
Creates an unsupported product throwing an exception if itsgetValue
method is called.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getValue(double evaluationTime, AnalyticModel model)
Return the valuation of the product using the given model.Object
getValue(double evaluationTime, Model model)
Return the valuation of the product using the given model.Map<String,Object>
getValues(double evaluationTime, Model model)
Return the valuation of the product using the given model.String
toString()
-
-
-
Constructor Detail
-
UnsupportedProduct
public UnsupportedProduct(Exception exception)
Creates an unsupported product throwing an exception if itsgetValue
method is called.- Parameters:
exception
- The exception to be thrown if this product is evaluated.
-
-
Method Detail
-
getValue
public Object getValue(double evaluationTime, Model model)
Description copied from interface:Product
Return the valuation of the product using the given model. Implement this method using a checked cast of the model to a derived model for which the product provides a valuation algorithm. Example: an interest rate product requires that the passed model object implements the interface of an interest rate model. Since there is no polymorphism on arguments (see Double Dynamic Dispatch), we reply on a checked cast.
-
getValue
public double getValue(double evaluationTime, AnalyticModel model)
Description copied from interface:AnalyticProduct
Return the valuation of the product using the given model. The model has to implement the modes ofAnalyticModel
.- Specified by:
getValue
in interfaceAnalyticProduct
- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.model
- The model under which the product is valued.- Returns:
- The value of the product using the given model.
-
getValues
public Map<String,Object> getValues(double evaluationTime, Model model)
Description copied from interface:Product
Return the valuation of the product using the given model. Implement this method using a checked cast of the model to a derived model for which the product provides a valuation algorithm. Example: an interest rate product requires that the passed model object implements the interface of an interest rate model. Since there is no polymorphism on arguments (see Double Dynamic Dispatch), we reply on a checked cast.
-
-