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

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

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

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = 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, _CalibrationHelper.CalibrationErrorType errorType) {
    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()), true);
  }

  public CapHelper(Period length, QuoteHandle volatility, IborIndex index, Frequency fixedLegFrequency, DayCounter fixedLegDayCounter, boolean includeFirstSwaplet, YieldTermStructureHandle termStructure) {
    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), true);
  }

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

}
