/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.quantlib;

public class OvernightIndexedSwap extends Swap {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected OvernightIndexedSwap(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.OvernightIndexedSwap_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(OvernightIndexedSwap obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        QuantLibJNI.delete_OvernightIndexedSwap(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates, RateAveraging.Type averagingMethod) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_0(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates, averagingMethod.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_1(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_2(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_3(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_4(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_5(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread), true);
  }

  public OvernightIndexedSwap(Swap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_6(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates, RateAveraging.Type averagingMethod) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_7(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates, averagingMethod.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_8(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_9(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag, BusinessDayConvention paymentAdjustment) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_10(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag, paymentAdjustment.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, int paymentLag) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_11(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread, paymentLag), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_12(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index, spread), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_13(type.swigValue(), DoubleVector.getCPtr(nominals), nominals, Schedule.getCPtr(schedule), schedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, OvernightIndex.getCPtr(index), index), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates, RateAveraging.Type averagingMethod) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_14(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates, averagingMethod.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar, boolean telescopicValueDates) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_15(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar, telescopicValueDates), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread, int paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_16(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread, paymentLag, paymentAdjustment.swigValue(), Calendar.getCPtr(paymentCalendar), paymentCalendar), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread, int paymentLag, BusinessDayConvention paymentAdjustment) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_17(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread, paymentLag, paymentAdjustment.swigValue()), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread, int paymentLag) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_18(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread, paymentLag), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex, double spread) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_19(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex, spread), true);
  }

  public OvernightIndexedSwap(Swap.Type type, DoubleVector fixedNominals, Schedule fixedSchedule, double fixedRate, DayCounter fixedDC, DoubleVector overnightNominals, Schedule overnightSchedule, OvernightIndex overnightIndex) {
    this(QuantLibJNI.new_OvernightIndexedSwap__SWIG_20(type.swigValue(), DoubleVector.getCPtr(fixedNominals), fixedNominals, Schedule.getCPtr(fixedSchedule), fixedSchedule, fixedRate, DayCounter.getCPtr(fixedDC), fixedDC, DoubleVector.getCPtr(overnightNominals), overnightNominals, Schedule.getCPtr(overnightSchedule), overnightSchedule, OvernightIndex.getCPtr(overnightIndex), overnightIndex), true);
  }

  public double fixedLegBPS() {
    return QuantLibJNI.OvernightIndexedSwap_fixedLegBPS(swigCPtr, this);
  }

  public double fixedLegNPV() {
    return QuantLibJNI.OvernightIndexedSwap_fixedLegNPV(swigCPtr, this);
  }

  public double fairRate() {
    return QuantLibJNI.OvernightIndexedSwap_fairRate(swigCPtr, this);
  }

  public double overnightLegBPS() {
    return QuantLibJNI.OvernightIndexedSwap_overnightLegBPS(swigCPtr, this);
  }

  public double overnightLegNPV() {
    return QuantLibJNI.OvernightIndexedSwap_overnightLegNPV(swigCPtr, this);
  }

  public double fairSpread() {
    return QuantLibJNI.OvernightIndexedSwap_fairSpread(swigCPtr, this);
  }

  public Swap.Type type() {
    return Swap.Type.swigToEnum(QuantLibJNI.OvernightIndexedSwap_type(swigCPtr, this));
  }

  public double nominal() {
    return QuantLibJNI.OvernightIndexedSwap_nominal(swigCPtr, this);
  }

  public DoubleVector nominals() {
    return new DoubleVector(QuantLibJNI.OvernightIndexedSwap_nominals(swigCPtr, this), true);
  }

  public Frequency paymentFrequency() {
    return Frequency.swigToEnum(QuantLibJNI.OvernightIndexedSwap_paymentFrequency(swigCPtr, this));
  }

  public double fixedRate() {
    return QuantLibJNI.OvernightIndexedSwap_fixedRate(swigCPtr, this);
  }

  public DayCounter fixedDayCount() {
    return new DayCounter(QuantLibJNI.OvernightIndexedSwap_fixedDayCount(swigCPtr, this), false);
  }

  public OvernightIndex overnightIndex() {
    long cPtr = QuantLibJNI.OvernightIndexedSwap_overnightIndex(swigCPtr, this);
    return (cPtr == 0) ? null : new OvernightIndex(cPtr, true);
  }

  public double spread() {
    return QuantLibJNI.OvernightIndexedSwap_spread(swigCPtr, this);
  }

  public Leg fixedLeg() {
    return new Leg(QuantLibJNI.OvernightIndexedSwap_fixedLeg(swigCPtr, this), false);
  }

  public Leg overnightLeg() {
    return new Leg(QuantLibJNI.OvernightIndexedSwap_overnightLeg(swigCPtr, this), false);
  }

  public RateAveraging.Type averagingMethod() {
    return RateAveraging.Type.swigToEnum(QuantLibJNI.OvernightIndexedSwap_averagingMethod(swigCPtr, this));
  }

}
