Record Class FixedLeg
java.lang.Object
java.lang.Record
com.quantfinlib.rates.FixedLeg
- Record Components:
start- unadjusted effective dateend- unadjusted maturityrate- fixed rate (decimal)convention- schedule, day count, calendar and payment lag
public record FixedLeg(LocalDate start, LocalDate end, double rate, LegConvention convention)
extends Record
The fixed leg of a
VanillaSwap: coupons rate * tau_i paid
on each period's payment date, with the schedule, day count, stub and
payment lag from a LegConvention. Values are per unit notional.
annuity = sum_{i: pay_i > valuation} tau_i P_d(pay_i)
pv = rate * annuity
-
Constructor Summary
ConstructorsConstructorDescriptionFixedLeg(LocalDate start, LocalDate end, double rate, LegConvention convention) Validates the fields. -
Method Summary
Modifier and TypeMethodDescriptiondoubleannuity(DiscountCurve discount) Annuity per unit notional and unit rate, over the coupons not yet paid.Returns the value of theconventionrecord component.end()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.periods()The leg's accrual periods.doublepv(DiscountCurve discount) PV per unit notional of the unpaid fixed coupons.doublerate()Returns the value of theraterecord component.start()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.withRate(double newRate) The same leg with a different fixed rate.
-
Constructor Details
-
FixedLeg
Validates the fields.
-
-
Method Details
-
periods
The leg's accrual periods.- Returns:
- the periods, ascending
-
annuity
Annuity per unit notional and unit rate, over the coupons not yet paid.- Parameters:
discount- discount curve- Returns:
- the annuity
-
pv
PV per unit notional of the unpaid fixed coupons.- Parameters:
discount- discount curve- Returns:
- present value
-
withRate
The same leg with a different fixed rate.- Parameters:
newRate- fixed rate- Returns:
- the new leg
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
start
-
end
-
rate
-
convention
Returns the value of theconventionrecord component.- Returns:
- the value of the
conventionrecord component
-