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 ZeroInflationTermStructureHandle implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected ZeroInflationTermStructureHandle(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(ZeroInflationTermStructureHandle obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(ZeroInflationTermStructureHandle 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_ZeroInflationTermStructureHandle(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public ZeroInflationTermStructureHandle(ZeroInflationTermStructure arg0) {
052    this(QuantLibJNI.new_ZeroInflationTermStructureHandle__SWIG_0(ZeroInflationTermStructure.getCPtr(arg0), arg0), true);
053  }
054
055  public ZeroInflationTermStructureHandle() {
056    this(QuantLibJNI.new_ZeroInflationTermStructureHandle__SWIG_1(), true);
057  }
058
059  public ZeroInflationTermStructure __deref__() {
060    long cPtr = QuantLibJNI.ZeroInflationTermStructureHandle___deref__(swigCPtr, this);
061    return (cPtr == 0) ? null : new ZeroInflationTermStructure(cPtr, true);
062  }
063
064  public ZeroInflationTermStructure currentLink() {
065    long cPtr = QuantLibJNI.ZeroInflationTermStructureHandle_currentLink(swigCPtr, this);
066    return (cPtr == 0) ? null : new ZeroInflationTermStructure(cPtr, true);
067  }
068
069  public boolean empty() {
070    return QuantLibJNI.ZeroInflationTermStructureHandle_empty(swigCPtr, this);
071  }
072
073  public Observable asObservable() {
074    long cPtr = QuantLibJNI.ZeroInflationTermStructureHandle_asObservable(swigCPtr, this);
075    return (cPtr == 0) ? null : new Observable(cPtr, true);
076  }
077
078  public double zeroRate(Date d, Period instObsLag, boolean forceLinearInterpolation, boolean extrapolate) {
079    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_0(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag, forceLinearInterpolation, extrapolate);
080  }
081
082  public double zeroRate(Date d, Period instObsLag, boolean forceLinearInterpolation) {
083    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_1(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag, forceLinearInterpolation);
084  }
085
086  public double zeroRate(Date d, Period instObsLag) {
087    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_2(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag);
088  }
089
090  public double zeroRate(Date d) {
091    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_3(swigCPtr, this, Date.getCPtr(d), d);
092  }
093
094  public double zeroRate(double t, boolean extrapolate) {
095    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_4(swigCPtr, this, t, extrapolate);
096  }
097
098  public double zeroRate(double t) {
099    return QuantLibJNI.ZeroInflationTermStructureHandle_zeroRate__SWIG_5(swigCPtr, this, t);
100  }
101
102  public Period observationLag() {
103    return new Period(QuantLibJNI.ZeroInflationTermStructureHandle_observationLag(swigCPtr, this), true);
104  }
105
106  public Frequency frequency() {
107    return Frequency.swigToEnum(QuantLibJNI.ZeroInflationTermStructureHandle_frequency(swigCPtr, this));
108  }
109
110  public double baseRate() {
111    return QuantLibJNI.ZeroInflationTermStructureHandle_baseRate(swigCPtr, this);
112  }
113
114  public Date baseDate() {
115    return new Date(QuantLibJNI.ZeroInflationTermStructureHandle_baseDate(swigCPtr, this), true);
116  }
117
118  public void setSeasonality(Seasonality seasonality) {
119    QuantLibJNI.ZeroInflationTermStructureHandle_setSeasonality__SWIG_0(swigCPtr, this, Seasonality.getCPtr(seasonality), seasonality);
120  }
121
122  public void setSeasonality() {
123    QuantLibJNI.ZeroInflationTermStructureHandle_setSeasonality__SWIG_1(swigCPtr, this);
124  }
125
126  public Seasonality seasonality() {
127    long cPtr = QuantLibJNI.ZeroInflationTermStructureHandle_seasonality(swigCPtr, this);
128    return (cPtr == 0) ? null : new Seasonality(cPtr, true);
129  }
130
131  public boolean hasSeasonality() {
132    return QuantLibJNI.ZeroInflationTermStructureHandle_hasSeasonality(swigCPtr, this);
133  }
134
135  public DayCounter dayCounter() {
136    return new DayCounter(QuantLibJNI.ZeroInflationTermStructureHandle_dayCounter(swigCPtr, this), true);
137  }
138
139  public double timeFromReference(Date date) {
140    return QuantLibJNI.ZeroInflationTermStructureHandle_timeFromReference(swigCPtr, this, Date.getCPtr(date), date);
141  }
142
143  public Calendar calendar() {
144    return new Calendar(QuantLibJNI.ZeroInflationTermStructureHandle_calendar(swigCPtr, this), true);
145  }
146
147  public Date referenceDate() {
148    return new Date(QuantLibJNI.ZeroInflationTermStructureHandle_referenceDate(swigCPtr, this), true);
149  }
150
151  public Date maxDate() {
152    return new Date(QuantLibJNI.ZeroInflationTermStructureHandle_maxDate(swigCPtr, this), true);
153  }
154
155  public double maxTime() {
156    return QuantLibJNI.ZeroInflationTermStructureHandle_maxTime(swigCPtr, this);
157  }
158
159  public void enableExtrapolation() {
160    QuantLibJNI.ZeroInflationTermStructureHandle_enableExtrapolation(swigCPtr, this);
161  }
162
163  public void disableExtrapolation() {
164    QuantLibJNI.ZeroInflationTermStructureHandle_disableExtrapolation(swigCPtr, this);
165  }
166
167  public boolean allowsExtrapolation() {
168    return QuantLibJNI.ZeroInflationTermStructureHandle_allowsExtrapolation(swigCPtr, this);
169  }
170
171}