/* ----------------------------------------------------------------------------
 * 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 ArithmeticOISRateHelper extends RateHelper {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

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

  protected static long getCPtr(ArithmeticOISRateHelper 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_ArithmeticOISRateHelper(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public ArithmeticOISRateHelper(long settlementDays, Period tenor, Frequency fixedLegPaymentFrequency, QuoteHandle fixedRate, OvernightIndex overnightIndex, Frequency overnightLegPaymentFrequency, QuoteHandle spread, double meanReversionSpeed, double volatility, boolean byApprox, YieldTermStructureHandle discountingCurve) {
    this(QuantLibJNI.new_ArithmeticOISRateHelper__SWIG_0(settlementDays, Period.getCPtr(tenor), tenor, fixedLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(fixedRate), fixedRate, OvernightIndex.getCPtr(overnightIndex), overnightIndex, overnightLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(spread), spread, meanReversionSpeed, volatility, byApprox, YieldTermStructureHandle.getCPtr(discountingCurve), discountingCurve), true);
  }

  public ArithmeticOISRateHelper(long settlementDays, Period tenor, Frequency fixedLegPaymentFrequency, QuoteHandle fixedRate, OvernightIndex overnightIndex, Frequency overnightLegPaymentFrequency, QuoteHandle spread, double meanReversionSpeed, double volatility, boolean byApprox) {
    this(QuantLibJNI.new_ArithmeticOISRateHelper__SWIG_1(settlementDays, Period.getCPtr(tenor), tenor, fixedLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(fixedRate), fixedRate, OvernightIndex.getCPtr(overnightIndex), overnightIndex, overnightLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(spread), spread, meanReversionSpeed, volatility, byApprox), true);
  }

  public ArithmeticOISRateHelper(long settlementDays, Period tenor, Frequency fixedLegPaymentFrequency, QuoteHandle fixedRate, OvernightIndex overnightIndex, Frequency overnightLegPaymentFrequency, QuoteHandle spread, double meanReversionSpeed, double volatility) {
    this(QuantLibJNI.new_ArithmeticOISRateHelper__SWIG_2(settlementDays, Period.getCPtr(tenor), tenor, fixedLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(fixedRate), fixedRate, OvernightIndex.getCPtr(overnightIndex), overnightIndex, overnightLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(spread), spread, meanReversionSpeed, volatility), true);
  }

  public ArithmeticOISRateHelper(long settlementDays, Period tenor, Frequency fixedLegPaymentFrequency, QuoteHandle fixedRate, OvernightIndex overnightIndex, Frequency overnightLegPaymentFrequency, QuoteHandle spread, double meanReversionSpeed) {
    this(QuantLibJNI.new_ArithmeticOISRateHelper__SWIG_3(settlementDays, Period.getCPtr(tenor), tenor, fixedLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(fixedRate), fixedRate, OvernightIndex.getCPtr(overnightIndex), overnightIndex, overnightLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(spread), spread, meanReversionSpeed), true);
  }

  public ArithmeticOISRateHelper(long settlementDays, Period tenor, Frequency fixedLegPaymentFrequency, QuoteHandle fixedRate, OvernightIndex overnightIndex, Frequency overnightLegPaymentFrequency, QuoteHandle spread) {
    this(QuantLibJNI.new_ArithmeticOISRateHelper__SWIG_4(settlementDays, Period.getCPtr(tenor), tenor, fixedLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(fixedRate), fixedRate, OvernightIndex.getCPtr(overnightIndex), overnightIndex, overnightLegPaymentFrequency.swigValue(), QuoteHandle.getCPtr(spread), spread), true);
  }

  public ArithmeticAverageOIS swap() {
    long cPtr = QuantLibJNI.ArithmeticOISRateHelper_swap(swigCPtr, this);
    return (cPtr == 0) ? null : new ArithmeticAverageOIS(cPtr, true);
  }

}
