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

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

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

  protected void finalize() {
    delete();
  }

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

  public Vasicek(double r0, double a, double b, double sigma, double lambda) {
    this(QuantLibJNI.new_Vasicek__SWIG_0(r0, a, b, sigma, lambda), true);
  }

  public Vasicek(double r0, double a, double b, double sigma) {
    this(QuantLibJNI.new_Vasicek__SWIG_1(r0, a, b, sigma), true);
  }

  public Vasicek(double r0, double a, double b) {
    this(QuantLibJNI.new_Vasicek__SWIG_2(r0, a, b), true);
  }

  public Vasicek(double r0, double a) {
    this(QuantLibJNI.new_Vasicek__SWIG_3(r0, a), true);
  }

  public Vasicek(double r0) {
    this(QuantLibJNI.new_Vasicek__SWIG_4(r0), true);
  }

  public Vasicek() {
    this(QuantLibJNI.new_Vasicek__SWIG_5(), true);
  }

  public double discount(double t) {
    return QuantLibJNI.Vasicek_discount(swigCPtr, this, t);
  }

  public double discountBond(double now, double maturity, double rate) {
    return QuantLibJNI.Vasicek_discountBond(swigCPtr, this, now, maturity, rate);
  }

}
