Class Payoff
- java.lang.Object
-
- org.jquantlib.instruments.Payoff
-
- All Implemented Interfaces:
- PolymorphicVisitable
- Direct Known Subclasses:
- ForwardTypePayoff, NullPayoff, TypePayoff
public abstract class Payoff extends java.lang.Object implements PolymorphicVisitable
Abstract base class for option payoffs
-
-
Constructor Summary
Constructors Constructor and Description Payoff()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaccept(PolymorphicVisitor pv)This method is intended to extend the semantics of methodVisitable.accept(Visitor)abstract java.lang.Stringdescription()abstract doubleget(double price)Returns the value of anInstrumentat maturity underPayoffconditionsabstract java.lang.Stringname()java.lang.StringtoString()
-
-
-
Method Detail
-
name
public abstract java.lang.String name()
-
description
public abstract java.lang.String description()
-
get
public abstract double get(double price)
Returns the value of anInstrumentat maturity underPayoffconditions
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public void accept(PolymorphicVisitor pv)
Description copied from interface:PolymorphicVisitableThis method is intended to extend the semantics of methodVisitable.accept(Visitor)In a conventional Visitor design pattern, the
acceptmethod is called when access to visit a data structure is requested. AVisitorobject is passed as argument in case permission is granted to thatVisitorto access the data structure. Obviously,Visitors andVisitables work in pairs and the class which provides the data structure to be visited also implementsVisitablein order to properly grant access when the expectedVisitoris received.In the case of a
PolymorphicVisitable, aPolymorphicVisitoris passed instead of aVisitor. APolymorphicVisitoris in fact, a composition ofVisitors and not only a singleVisitor. APolymorphicVisitoris responsible for returning the correctVisitorresponsible for processing a certain data structure.The initial design of pairs made of <
Visitor,Visitable> is extended to a concept of a matrix made of multipleVisitors against multipleVisitables. Every class which implementsPolymorphicVisitablepasses different data structures when queryingPolymorphicVisitors.- Specified by:
acceptin interfacePolymorphicVisitable- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG