001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (https://www.swig.org).
003 * Version 4.1.1
004 *
005 * Do not make changes to this file unless you know what you are doing - modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.quantlib;
010
011public class GJRGARCHProcess extends StochasticProcess implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwnDerived;
014
015  protected GJRGARCHProcess(long cPtr, boolean cMemoryOwn) {
016    super(QuantLibJNI.GJRGARCHProcess_SWIGSmartPtrUpcast(cPtr), true);
017    swigCMemOwnDerived = cMemoryOwn;
018    swigCPtr = cPtr;
019  }
020
021  protected static long getCPtr(GJRGARCHProcess obj) {
022    return (obj == null) ? 0 : obj.swigCPtr;
023  }
024
025  protected void swigSetCMemOwn(boolean own) {
026    swigCMemOwnDerived = own;
027    super.swigSetCMemOwn(own);
028  }
029
030  @SuppressWarnings("deprecation")
031  protected void finalize() {
032    delete();
033  }
034
035  public synchronized void delete() {
036    if (swigCPtr != 0) {
037      if (swigCMemOwnDerived) {
038        swigCMemOwnDerived = false;
039        QuantLibJNI.delete_GJRGARCHProcess(swigCPtr);
040      }
041      swigCPtr = 0;
042    }
043    super.delete();
044  }
045
046  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) {
047    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);
048  }
049
050  public GJRGARCHProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double omega, double alpha, double beta, double gamma, double lambda, double daysPerYear) {
051    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);
052  }
053
054  public GJRGARCHProcess(YieldTermStructureHandle riskFreeRate, YieldTermStructureHandle dividendYield, QuoteHandle s0, double v0, double omega, double alpha, double beta, double gamma, double lambda) {
055    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);
056  }
057
058  public QuoteHandle s0() {
059    return new QuoteHandle(QuantLibJNI.GJRGARCHProcess_s0(swigCPtr, this), true);
060  }
061
062  public YieldTermStructureHandle dividendYield() {
063    return new YieldTermStructureHandle(QuantLibJNI.GJRGARCHProcess_dividendYield(swigCPtr, this), true);
064  }
065
066  public YieldTermStructureHandle riskFreeRate() {
067    return new YieldTermStructureHandle(QuantLibJNI.GJRGARCHProcess_riskFreeRate(swigCPtr, this), true);
068  }
069
070  public final static class Discretization {
071    public final static GJRGARCHProcess.Discretization PartialTruncation = new GJRGARCHProcess.Discretization("PartialTruncation");
072    public final static GJRGARCHProcess.Discretization FullTruncation = new GJRGARCHProcess.Discretization("FullTruncation");
073    public final static GJRGARCHProcess.Discretization Reflection = new GJRGARCHProcess.Discretization("Reflection");
074
075    public final int swigValue() {
076      return swigValue;
077    }
078
079    public String toString() {
080      return swigName;
081    }
082
083    public static Discretization swigToEnum(int swigValue) {
084      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
085        return swigValues[swigValue];
086      for (int i = 0; i < swigValues.length; i++)
087        if (swigValues[i].swigValue == swigValue)
088          return swigValues[i];
089      throw new IllegalArgumentException("No enum " + Discretization.class + " with value " + swigValue);
090    }
091
092    private Discretization(String swigName) {
093      this.swigName = swigName;
094      this.swigValue = swigNext++;
095    }
096
097    private Discretization(String swigName, int swigValue) {
098      this.swigName = swigName;
099      this.swigValue = swigValue;
100      swigNext = swigValue+1;
101    }
102
103    private Discretization(String swigName, Discretization swigEnum) {
104      this.swigName = swigName;
105      this.swigValue = swigEnum.swigValue;
106      swigNext = this.swigValue+1;
107    }
108
109    private static Discretization[] swigValues = { PartialTruncation, FullTruncation, Reflection };
110    private static int swigNext = 0;
111    private final int swigValue;
112    private final String swigName;
113  }
114
115}