/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.1
 *
 * 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 YoYInflationTermStructureHandle {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected YoYInflationTermStructureHandle(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(YoYInflationTermStructureHandle obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(YoYInflationTermStructureHandle obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_YoYInflationTermStructureHandle(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public YoYInflationTermStructureHandle(YoYInflationTermStructure arg0) {
    this(QuantLibJNI.new_YoYInflationTermStructureHandle__SWIG_0(YoYInflationTermStructure.getCPtr(arg0), arg0), true);
  }

  public YoYInflationTermStructureHandle() {
    this(QuantLibJNI.new_YoYInflationTermStructureHandle__SWIG_1(), true);
  }

  public YoYInflationTermStructure __deref__() {
    long cPtr = QuantLibJNI.YoYInflationTermStructureHandle___deref__(swigCPtr, this);
    return (cPtr == 0) ? null : new YoYInflationTermStructure(cPtr, true);
  }

  public YoYInflationTermStructure currentLink() {
    long cPtr = QuantLibJNI.YoYInflationTermStructureHandle_currentLink(swigCPtr, this);
    return (cPtr == 0) ? null : new YoYInflationTermStructure(cPtr, true);
  }

  public boolean empty() {
    return QuantLibJNI.YoYInflationTermStructureHandle_empty(swigCPtr, this);
  }

  public Observable asObservable() {
    long cPtr = QuantLibJNI.YoYInflationTermStructureHandle_asObservable(swigCPtr, this);
    return (cPtr == 0) ? null : new Observable(cPtr, true);
  }

  public double yoyRate(Date d, Period instObsLag, boolean forceLinearInterpolation, boolean extrapolate) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_0(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag, forceLinearInterpolation, extrapolate);
  }

  public double yoyRate(Date d, Period instObsLag, boolean forceLinearInterpolation) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_1(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag, forceLinearInterpolation);
  }

  public double yoyRate(Date d, Period instObsLag) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_2(swigCPtr, this, Date.getCPtr(d), d, Period.getCPtr(instObsLag), instObsLag);
  }

  public double yoyRate(Date d) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_3(swigCPtr, this, Date.getCPtr(d), d);
  }

  public double yoyRate(double t, boolean extrapolate) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_4(swigCPtr, this, t, extrapolate);
  }

  public double yoyRate(double t) {
    return QuantLibJNI.YoYInflationTermStructureHandle_yoyRate__SWIG_5(swigCPtr, this, t);
  }

  public boolean indexIsInterpolated() {
    return QuantLibJNI.YoYInflationTermStructureHandle_indexIsInterpolated(swigCPtr, this);
  }

  public Period observationLag() {
    return new Period(QuantLibJNI.YoYInflationTermStructureHandle_observationLag(swigCPtr, this), true);
  }

  public Frequency frequency() {
    return Frequency.swigToEnum(QuantLibJNI.YoYInflationTermStructureHandle_frequency(swigCPtr, this));
  }

  public double baseRate() {
    return QuantLibJNI.YoYInflationTermStructureHandle_baseRate(swigCPtr, this);
  }

  public Date baseDate() {
    return new Date(QuantLibJNI.YoYInflationTermStructureHandle_baseDate(swigCPtr, this), true);
  }

  public void setSeasonality(Seasonality seasonality) {
    QuantLibJNI.YoYInflationTermStructureHandle_setSeasonality__SWIG_0(swigCPtr, this, Seasonality.getCPtr(seasonality), seasonality);
  }

  public void setSeasonality() {
    QuantLibJNI.YoYInflationTermStructureHandle_setSeasonality__SWIG_1(swigCPtr, this);
  }

  public Seasonality seasonality() {
    long cPtr = QuantLibJNI.YoYInflationTermStructureHandle_seasonality(swigCPtr, this);
    return (cPtr == 0) ? null : new Seasonality(cPtr, true);
  }

  public boolean hasSeasonality() {
    return QuantLibJNI.YoYInflationTermStructureHandle_hasSeasonality(swigCPtr, this);
  }

  public DayCounter dayCounter() {
    return new DayCounter(QuantLibJNI.YoYInflationTermStructureHandle_dayCounter(swigCPtr, this), true);
  }

  public double timeFromReference(Date date) {
    return QuantLibJNI.YoYInflationTermStructureHandle_timeFromReference(swigCPtr, this, Date.getCPtr(date), date);
  }

  public Calendar calendar() {
    return new Calendar(QuantLibJNI.YoYInflationTermStructureHandle_calendar(swigCPtr, this), true);
  }

  public Date referenceDate() {
    return new Date(QuantLibJNI.YoYInflationTermStructureHandle_referenceDate(swigCPtr, this), true);
  }

  public Date maxDate() {
    return new Date(QuantLibJNI.YoYInflationTermStructureHandle_maxDate(swigCPtr, this), true);
  }

  public double maxTime() {
    return QuantLibJNI.YoYInflationTermStructureHandle_maxTime(swigCPtr, this);
  }

  public void enableExtrapolation() {
    QuantLibJNI.YoYInflationTermStructureHandle_enableExtrapolation(swigCPtr, this);
  }

  public void disableExtrapolation() {
    QuantLibJNI.YoYInflationTermStructureHandle_disableExtrapolation(swigCPtr, this);
  }

  public boolean allowsExtrapolation() {
    return QuantLibJNI.YoYInflationTermStructureHandle_allowsExtrapolation(swigCPtr, this);
  }

}
