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 ASX implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected ASX(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(ASX obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(ASX obj) {
025    long ptr = 0;
026    if (obj != null) {
027      if (!obj.swigCMemOwn)
028        throw new RuntimeException("Cannot release ownership as memory is not owned");
029      ptr = obj.swigCPtr;
030      obj.swigCMemOwn = false;
031      obj.delete();
032    }
033    return ptr;
034  }
035
036  @SuppressWarnings("deprecation")
037  protected void finalize() {
038    delete();
039  }
040
041  public synchronized void delete() {
042    if (swigCPtr != 0) {
043      if (swigCMemOwn) {
044        swigCMemOwn = false;
045        QuantLibJNI.delete_ASX(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public static boolean isASXdate(Date d, boolean mainCycle) {
052    return QuantLibJNI.ASX_isASXdate__SWIG_0(Date.getCPtr(d), d, mainCycle);
053  }
054
055  public static boolean isASXdate(Date d) {
056    return QuantLibJNI.ASX_isASXdate__SWIG_1(Date.getCPtr(d), d);
057  }
058
059  public static boolean isASXcode(String code, boolean mainCycle) {
060    return QuantLibJNI.ASX_isASXcode__SWIG_0(code, mainCycle);
061  }
062
063  public static boolean isASXcode(String code) {
064    return QuantLibJNI.ASX_isASXcode__SWIG_1(code);
065  }
066
067  public static String code(Date asxDate) {
068    return QuantLibJNI.ASX_code(Date.getCPtr(asxDate), asxDate);
069  }
070
071  public static Date date(String asxCode, Date referenceDate) {
072    return new Date(QuantLibJNI.ASX_date__SWIG_0(asxCode, Date.getCPtr(referenceDate), referenceDate), true);
073  }
074
075  public static Date date(String asxCode) {
076    return new Date(QuantLibJNI.ASX_date__SWIG_1(asxCode), true);
077  }
078
079  public static Date nextDate(Date d, boolean mainCycle) {
080    return new Date(QuantLibJNI.ASX_nextDate__SWIG_0(Date.getCPtr(d), d, mainCycle), true);
081  }
082
083  public static Date nextDate(Date d) {
084    return new Date(QuantLibJNI.ASX_nextDate__SWIG_1(Date.getCPtr(d), d), true);
085  }
086
087  public static Date nextDate() {
088    return new Date(QuantLibJNI.ASX_nextDate__SWIG_2(), true);
089  }
090
091  public static Date nextDate(String asxCode, boolean mainCycle, Date referenceDate) {
092    return new Date(QuantLibJNI.ASX_nextDate__SWIG_3(asxCode, mainCycle, Date.getCPtr(referenceDate), referenceDate), true);
093  }
094
095  public static Date nextDate(String asxCode, boolean mainCycle) {
096    return new Date(QuantLibJNI.ASX_nextDate__SWIG_4(asxCode, mainCycle), true);
097  }
098
099  public static Date nextDate(String asxCode) {
100    return new Date(QuantLibJNI.ASX_nextDate__SWIG_5(asxCode), true);
101  }
102
103  public static String nextCode(Date d, boolean mainCycle) {
104    return QuantLibJNI.ASX_nextCode__SWIG_0(Date.getCPtr(d), d, mainCycle);
105  }
106
107  public static String nextCode(Date d) {
108    return QuantLibJNI.ASX_nextCode__SWIG_1(Date.getCPtr(d), d);
109  }
110
111  public static String nextCode() {
112    return QuantLibJNI.ASX_nextCode__SWIG_2();
113  }
114
115  public static String nextCode(String asxCode, boolean mainCycle, Date referenceDate) {
116    return QuantLibJNI.ASX_nextCode__SWIG_3(asxCode, mainCycle, Date.getCPtr(referenceDate), referenceDate);
117  }
118
119  public static String nextCode(String asxCode, boolean mainCycle) {
120    return QuantLibJNI.ASX_nextCode__SWIG_4(asxCode, mainCycle);
121  }
122
123  public static String nextCode(String asxCode) {
124    return QuantLibJNI.ASX_nextCode__SWIG_5(asxCode);
125  }
126
127  public ASX() {
128    this(QuantLibJNI.new_ASX(), true);
129  }
130
131  public final static class Month {
132    public final static ASX.Month F = new ASX.Month("F", QuantLibJNI.ASX_F_get());
133    public final static ASX.Month G = new ASX.Month("G", QuantLibJNI.ASX_G_get());
134    public final static ASX.Month H = new ASX.Month("H", QuantLibJNI.ASX_H_get());
135    public final static ASX.Month J = new ASX.Month("J", QuantLibJNI.ASX_J_get());
136    public final static ASX.Month K = new ASX.Month("K", QuantLibJNI.ASX_K_get());
137    public final static ASX.Month M = new ASX.Month("M", QuantLibJNI.ASX_M_get());
138    public final static ASX.Month N = new ASX.Month("N", QuantLibJNI.ASX_N_get());
139    public final static ASX.Month Q = new ASX.Month("Q", QuantLibJNI.ASX_Q_get());
140    public final static ASX.Month U = new ASX.Month("U", QuantLibJNI.ASX_U_get());
141    public final static ASX.Month V = new ASX.Month("V", QuantLibJNI.ASX_V_get());
142    public final static ASX.Month X = new ASX.Month("X", QuantLibJNI.ASX_X_get());
143    public final static ASX.Month Z = new ASX.Month("Z", QuantLibJNI.ASX_Z_get());
144
145    public final int swigValue() {
146      return swigValue;
147    }
148
149    public String toString() {
150      return swigName;
151    }
152
153    public static Month swigToEnum(int swigValue) {
154      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
155        return swigValues[swigValue];
156      for (int i = 0; i < swigValues.length; i++)
157        if (swigValues[i].swigValue == swigValue)
158          return swigValues[i];
159      throw new IllegalArgumentException("No enum " + Month.class + " with value " + swigValue);
160    }
161
162    private Month(String swigName) {
163      this.swigName = swigName;
164      this.swigValue = swigNext++;
165    }
166
167    private Month(String swigName, int swigValue) {
168      this.swigName = swigName;
169      this.swigValue = swigValue;
170      swigNext = swigValue+1;
171    }
172
173    private Month(String swigName, Month swigEnum) {
174      this.swigName = swigName;
175      this.swigValue = swigEnum.swigValue;
176      swigNext = this.swigValue+1;
177    }
178
179    private static Month[] swigValues = { F, G, H, J, K, M, N, Q, U, V, X, Z };
180    private static int swigNext = 0;
181    private final int swigValue;
182    private final String swigName;
183  }
184
185}