/* ----------------------------------------------------------------------------
 * 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 ZeroInflationCashFlow extends CashFlow {
  private transient long swigCPtr;
  private transient boolean swigCMemOwnDerived;

  protected ZeroInflationCashFlow(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.ZeroInflationCashFlow_SWIGSmartPtrUpcast(cPtr), true);
    swigCMemOwnDerived = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwnDerived = own;
    super.swigSetCMemOwn(own);
  }

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

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwnDerived) {
        swigCMemOwnDerived = false;
        QuantLibJNI.delete_ZeroInflationCashFlow(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public ZeroInflationCashFlow(double notional, ZeroInflationIndex index, CPI.InterpolationType observationInterpolation, Date startDate, Date endDate, Period observationLag, Date paymentDate, boolean growthOnly) {
    this(QuantLibJNI.new_ZeroInflationCashFlow__SWIG_0(notional, ZeroInflationIndex.getCPtr(index), index, observationInterpolation.swigValue(), Date.getCPtr(startDate), startDate, Date.getCPtr(endDate), endDate, Period.getCPtr(observationLag), observationLag, Date.getCPtr(paymentDate), paymentDate, growthOnly), true);
  }

  public ZeroInflationCashFlow(double notional, ZeroInflationIndex index, CPI.InterpolationType observationInterpolation, Date startDate, Date endDate, Period observationLag, Date paymentDate) {
    this(QuantLibJNI.new_ZeroInflationCashFlow__SWIG_1(notional, ZeroInflationIndex.getCPtr(index), index, observationInterpolation.swigValue(), Date.getCPtr(startDate), startDate, Date.getCPtr(endDate), endDate, Period.getCPtr(observationLag), observationLag, Date.getCPtr(paymentDate), paymentDate), true);
  }

  public double notional() {
    return QuantLibJNI.ZeroInflationCashFlow_notional(swigCPtr, this);
  }

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

  public Date fixingDate() {
    return new Date(QuantLibJNI.ZeroInflationCashFlow_fixingDate(swigCPtr, this), true);
  }

  public boolean growthOnly() {
    return QuantLibJNI.ZeroInflationCashFlow_growthOnly(swigCPtr, this);
  }

  public CPI.InterpolationType observationInterpolation() {
    return CPI.InterpolationType.swigToEnum(QuantLibJNI.ZeroInflationCashFlow_observationInterpolation(swigCPtr, this));
  }

  public ZeroInflationIndex zeroInflationIndex() {
    long cPtr = QuantLibJNI.ZeroInflationCashFlow_zeroInflationIndex(swigCPtr, this);
    return (cPtr == 0) ? null : new ZeroInflationIndex(cPtr, true);
  }

}
