/* ----------------------------------------------------------------------------
 * 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 Schedule {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

  public Schedule(Calendar calendar, Date startDate, Date endDate, Frequency frequency, BusinessDayConvention rollingConvention, Date stubDate, boolean startFromEnd, boolean longFinal) {
    this(QuantLibJNI.new_Schedule__SWIG_0(Calendar.getCPtr(calendar), Date.getCPtr(startDate), Date.getCPtr(endDate), frequency.swigValue(), rollingConvention.swigValue(), Date.getCPtr(stubDate), startFromEnd, longFinal), true);
  }

  public Schedule(Calendar calendar, Date startDate, Date endDate, Frequency frequency, BusinessDayConvention rollingConvention, Date stubDate, boolean startFromEnd) {
    this(QuantLibJNI.new_Schedule__SWIG_1(Calendar.getCPtr(calendar), Date.getCPtr(startDate), Date.getCPtr(endDate), frequency.swigValue(), rollingConvention.swigValue(), Date.getCPtr(stubDate), startFromEnd), true);
  }

  public Schedule(Calendar calendar, Date startDate, Date endDate, Frequency frequency, BusinessDayConvention rollingConvention, Date stubDate) {
    this(QuantLibJNI.new_Schedule__SWIG_2(Calendar.getCPtr(calendar), Date.getCPtr(startDate), Date.getCPtr(endDate), frequency.swigValue(), rollingConvention.swigValue(), Date.getCPtr(stubDate)), true);
  }

  public Schedule(Calendar calendar, Date startDate, Date endDate, Frequency frequency, BusinessDayConvention rollingConvention) {
    this(QuantLibJNI.new_Schedule__SWIG_3(Calendar.getCPtr(calendar), Date.getCPtr(startDate), Date.getCPtr(endDate), frequency.swigValue(), rollingConvention.swigValue()), true);
  }

  public Schedule(DateVector arg0, Calendar calendar, BusinessDayConvention rollingConvention) {
    this(QuantLibJNI.new_Schedule__SWIG_4(DateVector.getCPtr(arg0), Calendar.getCPtr(calendar), rollingConvention.swigValue()), true);
  }

  public long size() {
    return QuantLibJNI.Schedule_size(swigCPtr);
  }

  public Date date(long i) {
    return new Date(QuantLibJNI.Schedule_date(swigCPtr, i), true);
  }

  public boolean isRegular(long i) {
    return QuantLibJNI.Schedule_isRegular(swigCPtr, i);
  }

}
