Class PlainVanillaPayoff
- java.lang.Object
-
- org.jquantlib.instruments.Payoff
-
- org.jquantlib.instruments.TypePayoff
-
- org.jquantlib.instruments.StrikedTypePayoff
-
- org.jquantlib.instruments.PlainVanillaPayoff
-
- All Implemented Interfaces:
- PolymorphicVisitable
public class PlainVanillaPayoff extends StrikedTypePayoff
Plain-vanilla payoffPays off nothing if the underlying asset price finishes below/above the strike price , or pays out a the difference between the asset price and the strike price if the underlying asset finishes above/below the strike price.
- See Also:
- Binary Options
-
-
Constructor Summary
Constructors Constructor and Description PlainVanillaPayoff(Option.Type type, double strike)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaccept(PolymorphicVisitor pv)This method is intended to extend the semantics of methodVisitable.accept(Visitor)doubleget(double price)Pays off nothing if the underlying asset price finishes below/above the strike price , or pays out a the difference between the asset price and the strike price if the underlying asset finishes above/below the strike price.java.lang.Stringname()-
Methods inherited from class org.jquantlib.instruments.StrikedTypePayoff
description, strike
-
Methods inherited from class org.jquantlib.instruments.TypePayoff
optionType
-
-
-
-
Constructor Detail
-
PlainVanillaPayoff
public PlainVanillaPayoff(Option.Type type, double strike)
-
-
Method Detail
-
get
public final double get(double price)
Pays off nothing if the underlying asset price finishes below/above the strike price , or pays out a the difference between the asset price and the strike price if the underlying asset finishes above/below the strike price.- CALL Option:
- PUT Option:
where is the asset price at maturity and is the strike price.
-
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- Overrides:
acceptin classPayoff- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG