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

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

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

  public GJRGARCHProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double omega, double alpha, double beta, double gamma, double lambda, double daysPerYear, GJRGARCHProcess.Discretization d) {
    this(QuantLibJNI.new_GJRGARCHProcess__SWIG_0(YieldTermStructureHandle.getCPtr(riskFreeRate), riskFreeRate, YieldTermStructureHandle.getCPtr(dividendYield), dividendYield, QuoteHandle.getCPtr(s0), s0, v0, omega, alpha, beta, gamma, lambda, daysPerYear, d.swigValue()), true);
  }

  public GJRGARCHProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double omega, double alpha, double beta, double gamma, double lambda, double daysPerYear) {
    this(QuantLibJNI.new_GJRGARCHProcess__SWIG_1(YieldTermStructureHandle.getCPtr(riskFreeRate), riskFreeRate, YieldTermStructureHandle.getCPtr(dividendYield), dividendYield, QuoteHandle.getCPtr(s0), s0, v0, omega, alpha, beta, gamma, lambda, daysPerYear), true);
  }

  public GJRGARCHProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double omega, double alpha, double beta, double gamma, double lambda) {
    this(QuantLibJNI.new_GJRGARCHProcess__SWIG_2(YieldTermStructureHandle.getCPtr(riskFreeRate), riskFreeRate, YieldTermStructureHandle.getCPtr(dividendYield), dividendYield, QuoteHandle.getCPtr(s0), s0, v0, omega, alpha, beta, gamma, lambda), true);
  }

  public QuoteHandle s0() {
    return new QuoteHandle(QuantLibJNI.GJRGARCHProcess_s0(swigCPtr, this), true);
  }

  public YieldTermStructureHandle dividendYield() {
    return new YieldTermStructureHandle(QuantLibJNI.GJRGARCHProcess_dividendYield(swigCPtr, this), true);
  }

  public YieldTermStructureHandle riskFreeRate() {
    return new YieldTermStructureHandle(QuantLibJNI.GJRGARCHProcess_riskFreeRate(swigCPtr, this), true);
  }

  public final static class Discretization {
    public final static GJRGARCHProcess.Discretization PartialTruncation = new GJRGARCHProcess.Discretization("PartialTruncation");
    public final static GJRGARCHProcess.Discretization FullTruncation = new GJRGARCHProcess.Discretization("FullTruncation");
    public final static GJRGARCHProcess.Discretization Reflection = new GJRGARCHProcess.Discretization("Reflection");

    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 = { PartialTruncation, FullTruncation, Reflection };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
