/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * 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 CapHelper extends BlackCalibrationHelper {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

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

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

  public CapHelper(Period length, QuoteHandle volatility, IborIndex index, Frequency fixedLegFrequency, DayCounter fixedLegDayCounter, boolean includeFirstSwaplet, YieldTermStructureHandle termStructure, BlackCalibrationHelper.CalibrationErrorType errorType, VolatilityType type, double shift) {
    this(QuantLibJNI.new_CapHelper__SWIG_0(Period.getCPtr(length), length, QuoteHandle.getCPtr(volatility), volatility, IborIndex.getCPtr(index), index, fixedLegFrequency.swigValue(), DayCounter.getCPtr(fixedLegDayCounter), fixedLegDayCounter, includeFirstSwaplet, YieldTermStructureHandle.getCPtr(termStructure), termStructure, errorType.swigValue(), type.swigValue(), shift), true);
  }

  public CapHelper(Period length, QuoteHandle volatility, IborIndex index, Frequency fixedLegFrequency, DayCounter fixedLegDayCounter, boolean includeFirstSwaplet, YieldTermStructureHandle termStructure, BlackCalibrationHelper.CalibrationErrorType errorType, VolatilityType type) {
    this(QuantLibJNI.new_CapHelper__SWIG_1(Period.getCPtr(length), length, QuoteHandle.getCPtr(volatility), volatility, IborIndex.getCPtr(index), index, fixedLegFrequency.swigValue(), DayCounter.getCPtr(fixedLegDayCounter), fixedLegDayCounter, includeFirstSwaplet, YieldTermStructureHandle.getCPtr(termStructure), termStructure, errorType.swigValue(), type.swigValue()), true);
  }

  public CapHelper(Period length, QuoteHandle volatility, IborIndex index, Frequency fixedLegFrequency, DayCounter fixedLegDayCounter, boolean includeFirstSwaplet, YieldTermStructureHandle termStructure, BlackCalibrationHelper.CalibrationErrorType errorType) {
    this(QuantLibJNI.new_CapHelper__SWIG_2(Period.getCPtr(length), length, QuoteHandle.getCPtr(volatility), volatility, IborIndex.getCPtr(index), index, fixedLegFrequency.swigValue(), DayCounter.getCPtr(fixedLegDayCounter), fixedLegDayCounter, includeFirstSwaplet, YieldTermStructureHandle.getCPtr(termStructure), termStructure, errorType.swigValue()), true);
  }

  public CapHelper(Period length, QuoteHandle volatility, IborIndex index, Frequency fixedLegFrequency, DayCounter fixedLegDayCounter, boolean includeFirstSwaplet, YieldTermStructureHandle termStructure) {
    this(QuantLibJNI.new_CapHelper__SWIG_3(Period.getCPtr(length), length, QuoteHandle.getCPtr(volatility), volatility, IborIndex.getCPtr(index), index, fixedLegFrequency.swigValue(), DayCounter.getCPtr(fixedLegDayCounter), fixedLegDayCounter, includeFirstSwaplet, YieldTermStructureHandle.getCPtr(termStructure), termStructure), true);
  }

  public DoubleVector times() {
    return new DoubleVector(QuantLibJNI.CapHelper_times(swigCPtr, this), true);
  }

}
