/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.29
 *
 * 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 SwapRateHelper extends RateHelper {
  private long swigCPtr;

  protected SwapRateHelper(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.SWIGSwapRateHelperUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      QuantLibJNI.delete_SwapRateHelper(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  public SwapRateHelper(QuoteHandle rate, int n, TimeUnit units, int settlementDays, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, Frequency floatingFrequency, BusinessDayConvention floatingConvention, DayCounter floatingDayCount) {
    this(QuantLibJNI.new_SwapRateHelper__SWIG_0(QuoteHandle.getCPtr(rate), n, units.swigValue(), settlementDays, Calendar.getCPtr(calendar), fixedFrequency.swigValue(), fixedConvention.swigValue(), DayCounter.getCPtr(fixedDayCount), floatingFrequency.swigValue(), floatingConvention.swigValue(), DayCounter.getCPtr(floatingDayCount)), true);
  }

  public SwapRateHelper(double rate, int n, TimeUnit units, int settlementDays, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, Frequency floatingFrequency, BusinessDayConvention floatingConvention, DayCounter floatingDayCount) {
    this(QuantLibJNI.new_SwapRateHelper__SWIG_1(rate, n, units.swigValue(), settlementDays, Calendar.getCPtr(calendar), fixedFrequency.swigValue(), fixedConvention.swigValue(), DayCounter.getCPtr(fixedDayCount), floatingFrequency.swigValue(), floatingConvention.swigValue(), DayCounter.getCPtr(floatingDayCount)), true);
  }

  public SwapRateHelper(QuoteHandle rate, Period tenor, int settlementDays, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, Xibor index) {
    this(QuantLibJNI.new_SwapRateHelper__SWIG_2(QuoteHandle.getCPtr(rate), Period.getCPtr(tenor), settlementDays, Calendar.getCPtr(calendar), fixedFrequency.swigValue(), fixedConvention.swigValue(), DayCounter.getCPtr(fixedDayCount), Xibor.getCPtr(index)), true);
  }

  public SwapRateHelper(double rate, Period tenor, int settlementDays, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, Xibor index) {
    this(QuantLibJNI.new_SwapRateHelper__SWIG_3(rate, Period.getCPtr(tenor), settlementDays, Calendar.getCPtr(calendar), fixedFrequency.swigValue(), fixedConvention.swigValue(), DayCounter.getCPtr(fixedDayCount), Xibor.getCPtr(index)), true);
  }

}
