Interface PolymorphicVisitable
-
- Type Parameters:
T- defines the data structure to be visited
- All Known Implementing Classes:
- AssetOrNothingPayoff, AverageBMACoupon, BlackConstantVol, BlackVarianceCurve, BlackVarianceSurface, BlackVarianceTermStructure, BlackVolatilityTermStructure, BlackVolTermStructure, BMASwapRateHelper, BootstrapHelper, Callability, CappedFlooredCmsCoupon, CappedFlooredCoupon, CappedFlooredIborCoupon, CashFlow, CashOrNothingPayoff, CmsCoupon, Coupon, DepositRateHelper, Dividend, Event, FixedDividend, FixedRateBondHelper, FixedRateCoupon, FloatingRateCoupon, ForwardTypePayoff, FractionalDividend, FraRateHelper, FuturesRateHelper, GapPayoff, IborCoupon, ImpliedVolTermStructure, LocalConstantVol, LocalVolCurve, LocalVolSurface, LocalVolTermStructure, NullPayoff, Payoff, PlainVanillaPayoff, RateHelper, RelativeDateRateHelper, SimpleCashFlow, SoftCallability, StrikedTypePayoff, SwapRateHelper, TypePayoff
public interface PolymorphicVisitableThis interface works together withPolymorphicVisitorin order to provide the functionality of obtaining a specificVisitor.This functionality is needed every time a class acts as a Visitor of more than one data structure or when a class acting as a Visitable requires a certain kind of Visitor.
- See Also:
Visitor,Visitable,PolymorphicVisitor, The Visitor Design Pattern
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaccept(PolymorphicVisitor pv)This method is intended to extend the semantics of methodVisitable.accept(Visitor)
-
-
-
Method Detail
-
accept
void accept(PolymorphicVisitor pv)
This 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.- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG