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

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

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

  public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b, ExtendedOrnsteinUhlenbeckProcess.Discretization discretization, double intEps) {
    this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_0(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b), discretization.swigValue(), intEps), true);
  }

  public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b, ExtendedOrnsteinUhlenbeckProcess.Discretization discretization) {
    this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_1(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b), discretization.swigValue()), true);
  }

  public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t b) {
    this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_2(speed, sigma, x0, SWIGTYPE_p_ext__functionT_double_fdoubleF_t.getCPtr(b)), true);
  }

  public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, UnaryFunctionDelegate function, double intEps) {
    this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_3(speed, sigma, x0, UnaryFunctionDelegate.getCPtr(function), function, intEps), true);
  }

  public ExtendedOrnsteinUhlenbeckProcess(double speed, double sigma, double x0, UnaryFunctionDelegate function) {
    this(QuantLibJNI.new_ExtendedOrnsteinUhlenbeckProcess__SWIG_4(speed, sigma, x0, UnaryFunctionDelegate.getCPtr(function), function), true);
  }

  public final static class Discretization {
    public final static ExtendedOrnsteinUhlenbeckProcess.Discretization MidPoint = new ExtendedOrnsteinUhlenbeckProcess.Discretization("MidPoint");
    public final static ExtendedOrnsteinUhlenbeckProcess.Discretization Trapezodial = new ExtendedOrnsteinUhlenbeckProcess.Discretization("Trapezodial");
    public final static ExtendedOrnsteinUhlenbeckProcess.Discretization GaussLobatto = new ExtendedOrnsteinUhlenbeckProcess.Discretization("GaussLobatto");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static Discretization swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + Discretization.class + " with value " + swigValue);
    }

    private Discretization(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private Discretization(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private Discretization(String swigName, Discretization swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static Discretization[] swigValues = { MidPoint, Trapezodial, GaussLobatto };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
