/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.0
 *
 * 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 PiecewiseConstantCorrelation {
  private transient long swigCPtr;
  private transient boolean swigCMemOwn;

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

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

  protected void swigSetCMemOwn(boolean own) {
    swigCMemOwn = own;
  }

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

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

  public DoubleVector times() {
    return new DoubleVector(QuantLibJNI.PiecewiseConstantCorrelation_times(swigCPtr, this), false);
  }

  public DoubleVector rateTimes() {
    return new DoubleVector(QuantLibJNI.PiecewiseConstantCorrelation_rateTimes(swigCPtr, this), false);
  }

  public SWIGTYPE_p_std__vectorT_Matrix_t correlations() {
    return new SWIGTYPE_p_std__vectorT_Matrix_t(QuantLibJNI.PiecewiseConstantCorrelation_correlations(swigCPtr, this), false);
  }

  public Matrix correlation(long i) {
    return new Matrix(QuantLibJNI.PiecewiseConstantCorrelation_correlation(swigCPtr, this, i), false);
  }

  public long numberOfRates() {
    return QuantLibJNI.PiecewiseConstantCorrelation_numberOfRates(swigCPtr, this);
  }

}
