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

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

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

  public DividendVanillaOption(StrikedTypePayoff payoff, Exercise exercise, DateVector dividendDates, DoubleVector dividends) {
    this(QuantLibJNI.new_DividendVanillaOption(StrikedTypePayoff.getCPtr(payoff), payoff, Exercise.getCPtr(exercise), exercise, DateVector.getCPtr(dividendDates), dividendDates, DoubleVector.getCPtr(dividends), dividends), true);
  }

  public double impliedVolatility(double targetValue, GeneralizedBlackScholesProcess process, double accuracy, long maxEvaluations, double minVol, double maxVol) {
    return QuantLibJNI.DividendVanillaOption_impliedVolatility__SWIG_0(swigCPtr, this, targetValue, GeneralizedBlackScholesProcess.getCPtr(process), process, accuracy, maxEvaluations, minVol, maxVol);
  }

  public double impliedVolatility(double targetValue, GeneralizedBlackScholesProcess process, double accuracy, long maxEvaluations, double minVol) {
    return QuantLibJNI.DividendVanillaOption_impliedVolatility__SWIG_1(swigCPtr, this, targetValue, GeneralizedBlackScholesProcess.getCPtr(process), process, accuracy, maxEvaluations, minVol);
  }

  public double impliedVolatility(double targetValue, GeneralizedBlackScholesProcess process, double accuracy, long maxEvaluations) {
    return QuantLibJNI.DividendVanillaOption_impliedVolatility__SWIG_2(swigCPtr, this, targetValue, GeneralizedBlackScholesProcess.getCPtr(process), process, accuracy, maxEvaluations);
  }

  public double impliedVolatility(double targetValue, GeneralizedBlackScholesProcess process, double accuracy) {
    return QuantLibJNI.DividendVanillaOption_impliedVolatility__SWIG_3(swigCPtr, this, targetValue, GeneralizedBlackScholesProcess.getCPtr(process), process, accuracy);
  }

  public double impliedVolatility(double targetValue, GeneralizedBlackScholesProcess process) {
    return QuantLibJNI.DividendVanillaOption_impliedVolatility__SWIG_4(swigCPtr, this, targetValue, GeneralizedBlackScholesProcess.getCPtr(process), process);
  }

}
