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 InflationTermStructure extends TermStructure implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwnDerived;
014
015  protected InflationTermStructure(long cPtr, boolean cMemoryOwn) {
016    super(QuantLibJNI.InflationTermStructure_SWIGSmartPtrUpcast(cPtr), true);
017    swigCMemOwnDerived = cMemoryOwn;
018    swigCPtr = cPtr;
019  }
020
021  protected static long getCPtr(InflationTermStructure 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_InflationTermStructure(swigCPtr);
040      }
041      swigCPtr = 0;
042    }
043    super.delete();
044  }
045
046  public Period observationLag() {
047    return new Period(QuantLibJNI.InflationTermStructure_observationLag(swigCPtr, this), true);
048  }
049
050  public Frequency frequency() {
051    return Frequency.swigToEnum(QuantLibJNI.InflationTermStructure_frequency(swigCPtr, this));
052  }
053
054  public double baseRate() {
055    return QuantLibJNI.InflationTermStructure_baseRate(swigCPtr, this);
056  }
057
058  public Date baseDate() {
059    return new Date(QuantLibJNI.InflationTermStructure_baseDate(swigCPtr, this), true);
060  }
061
062  public void setSeasonality(Seasonality seasonality) {
063    QuantLibJNI.InflationTermStructure_setSeasonality__SWIG_0(swigCPtr, this, Seasonality.getCPtr(seasonality), seasonality);
064  }
065
066  public void setSeasonality() {
067    QuantLibJNI.InflationTermStructure_setSeasonality__SWIG_1(swigCPtr, this);
068  }
069
070  public Seasonality seasonality() {
071    long cPtr = QuantLibJNI.InflationTermStructure_seasonality(swigCPtr, this);
072    return (cPtr == 0) ? null : new Seasonality(cPtr, true);
073  }
074
075  public boolean hasSeasonality() {
076    return QuantLibJNI.InflationTermStructure_hasSeasonality(swigCPtr, this);
077  }
078
079}