Class Coupon
- java.lang.Object
-
- org.jquantlib.cashflow.Event
-
- org.jquantlib.cashflow.CashFlow
-
- org.jquantlib.cashflow.Coupon
-
- All Implemented Interfaces:
- java.lang.Comparable<CashFlow>, Observable, PolymorphicVisitable
- Direct Known Subclasses:
- FixedRateCoupon, FloatingRateCoupon
public abstract class Coupon extends CashFlow
Coupon accruing over a fixed periodThis class implements part of the CashFlow interface but it is still abstract and provides derived classes with methods for accrual period calculations.
-
-
Constructor Summary
Constructors Constructor and Description Coupon(double nominal, Date paymentDate, Date accrualStartDate, Date accrualEndDate)Coupon(double nominal, Date paymentDate, Date accrualStartDate, Date accrualEndDate, Date refPeriodStart, Date refPeriodEnd)
-
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)longaccrualDays()DateaccrualEndDate()doubleaccrualPeriod()DateaccrualStartDate()abstract doubleaccruedAmount(Date date)Datedate()Keeps the date at which the event occursabstract DayCounterdayCounter()doublenominal()abstract doublerate()DatereferencePeriodEnd()DatereferencePeriodStart()-
Methods inherited from class org.jquantlib.cashflow.Event
addObserver, countObservers, deleteObserver, deleteObservers, getObservers, hasOccurred, hasOccurred, notifyObservers, notifyObservers
-
-
-
-
Method Detail
-
rate
public abstract double rate()
-
dayCounter
public abstract DayCounter dayCounter()
-
accruedAmount
public abstract double accruedAmount(Date date)
-
nominal
public double nominal()
-
accrualStartDate
public Date accrualStartDate()
-
accrualEndDate
public Date accrualEndDate()
-
referencePeriodStart
public Date referencePeriodStart()
-
referencePeriodEnd
public Date referencePeriodEnd()
-
accrualPeriod
public double accrualPeriod()
-
accrualDays
public long accrualDays()
-
date
public Date date()
Description copied from class:EventKeeps the date at which the event occurs
-
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 classCashFlow- See Also:
PolymorphicVisitor#getVisitor(Class)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG