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

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

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

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise, Settlement.Type delivery, Settlement.Method settlementMethod) {
    this(QuantLibJNI.new_FloatFloatSwaption__SWIG_0(FloatFloatSwap.getCPtr(swap), swap, Exercise.getCPtr(exercise), exercise, delivery.swigValue(), settlementMethod.swigValue()), true);
  }

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise, Settlement.Type delivery) {
    this(QuantLibJNI.new_FloatFloatSwaption__SWIG_1(FloatFloatSwap.getCPtr(swap), swap, Exercise.getCPtr(exercise), exercise, delivery.swigValue()), true);
  }

  public FloatFloatSwaption(FloatFloatSwap swap, Exercise exercise) {
    this(QuantLibJNI.new_FloatFloatSwaption__SWIG_2(FloatFloatSwap.getCPtr(swap), swap, Exercise.getCPtr(exercise), exercise), true);
  }

  public FloatFloatSwap underlyingSwap() {
    long cPtr = QuantLibJNI.FloatFloatSwaption_underlyingSwap(swigCPtr, this);
    return (cPtr == 0) ? null : new FloatFloatSwap(cPtr, true);
  }

  public BlackCalibrationHelperVector calibrationBasket(SwapIndex swapIndex, SwaptionVolatilityStructure swaptionVolatility, String typeStr) {
    return new BlackCalibrationHelperVector(QuantLibJNI.FloatFloatSwaption_calibrationBasket(swigCPtr, this, SwapIndex.getCPtr(swapIndex), swapIndex, SwaptionVolatilityStructure.getCPtr(swaptionVolatility), swaptionVolatility, typeStr), true);
  }

  public double underlyingValue() {
    return QuantLibJNI.FloatFloatSwaption_underlyingValue(swigCPtr, this);
  }

  public DoubleVector probabilities() {
    return new DoubleVector(QuantLibJNI.FloatFloatSwaption_probabilities(swigCPtr, this), true);
  }

}
