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

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

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

  protected void finalize() {
    delete();
  }

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

  public TimeBasket() {
    this(QuantLibJNI.new_TimeBasket__SWIG_0(), true);
  }

  public TimeBasket(DateVector arg0, DoubleVector arg1) {
    this(QuantLibJNI.new_TimeBasket__SWIG_1(DateVector.getCPtr(arg0), DoubleVector.getCPtr(arg1)), true);
  }

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

  public TimeBasket rebin(DateVector arg0) {
    return new TimeBasket(QuantLibJNI.TimeBasket_rebin(swigCPtr, DateVector.getCPtr(arg0)), true);
  }

}
