Record Class Deposit

java.lang.Object
java.lang.Record
com.quantfinlib.rates.Deposit
All Implemented Interfaces:
CurveInstrument

public record Deposit(LocalDate start, LocalDate end, double rate, DayCount dayCount) extends Record implements CurveInstrument
A cash deposit over [start, end] at simple rate rate: 1 at start grows to 1 + rate * tau at end, tau from dayCount. Implied rate: the projection curve's simple forward (P(start)/P(end) - 1)/tau. Dates are taken as already adjusted.
  • Constructor Details

    • Deposit

      public Deposit(LocalDate start, LocalDate end, double rate, DayCount dayCount)
      Creates an instance of a Deposit record class.
      Parameters:
      start - the value for the start record component
      end - the value for the end record component
      rate - the value for the rate record component
      dayCount - the value for the dayCount record component
  • Method Details

    • pillarDate

      public LocalDate pillarDate()
      Description copied from interface: CurveInstrument
      The last date the instrument depends on; the bootstrap places a pillar there.
      Specified by:
      pillarDate in interface CurveInstrument
    • quote

      public double quote()
      Description copied from interface: CurveInstrument
      The market quote as a decimal rate (0.03 = 3%).
      Specified by:
      quote in interface CurveInstrument
    • withQuote

      public Deposit withQuote(double quote)
      Description copied from interface: CurveInstrument
      The same instrument with a different quote (used for bump-and-rebuild risk).
      Specified by:
      withQuote in interface CurveInstrument
    • impliedQuote

      public double impliedQuote(DiscountCurve discount, DiscountCurve projection)
      Description copied from interface: CurveInstrument
      The quote implied by the curves, in the units of CurveInstrument.quote().
      Specified by:
      impliedQuote in interface CurveInstrument
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • start

      public LocalDate start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public LocalDate end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • rate

      public double rate()
      Returns the value of the rate record component.
      Returns:
      the value of the rate record component
    • dayCount

      public DayCount dayCount()
      Returns the value of the dayCount record component.
      Returns:
      the value of the dayCount record component