/* ----------------------------------------------------------------------------
 * 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 NonstandardSwap extends Swap {
  private transient long swigCPtr;

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

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

  protected void finalize() {
    delete();
  }

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

  public NonstandardSwap(_VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, boolean intermediateCapitalExchange, boolean finalCapitalExchange, BusinessDayConvention paymentConvention) {
    this(QuantLibJNI.new_NonstandardSwap__SWIG_0(type.swigValue(), DoubleVector.getCPtr(fixedNominal), fixedNominal, DoubleVector.getCPtr(floatingNominal), floatingNominal, Schedule.getCPtr(fixedSchedule), fixedSchedule, DoubleVector.getCPtr(fixedRate), fixedRate, DayCounter.getCPtr(fixedDayCount), fixedDayCount, Schedule.getCPtr(floatSchedule), floatSchedule, IborIndex.getCPtr(index), index, DoubleVector.getCPtr(gearing), gearing, DoubleVector.getCPtr(spread), spread, DayCounter.getCPtr(floatDayCount), floatDayCount, intermediateCapitalExchange, finalCapitalExchange, paymentConvention.swigValue()), true);
  }

  public NonstandardSwap(_VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, boolean intermediateCapitalExchange, boolean finalCapitalExchange) {
    this(QuantLibJNI.new_NonstandardSwap__SWIG_1(type.swigValue(), DoubleVector.getCPtr(fixedNominal), fixedNominal, DoubleVector.getCPtr(floatingNominal), floatingNominal, Schedule.getCPtr(fixedSchedule), fixedSchedule, DoubleVector.getCPtr(fixedRate), fixedRate, DayCounter.getCPtr(fixedDayCount), fixedDayCount, Schedule.getCPtr(floatSchedule), floatSchedule, IborIndex.getCPtr(index), index, DoubleVector.getCPtr(gearing), gearing, DoubleVector.getCPtr(spread), spread, DayCounter.getCPtr(floatDayCount), floatDayCount, intermediateCapitalExchange, finalCapitalExchange), true);
  }

  public NonstandardSwap(_VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, boolean intermediateCapitalExchange) {
    this(QuantLibJNI.new_NonstandardSwap__SWIG_2(type.swigValue(), DoubleVector.getCPtr(fixedNominal), fixedNominal, DoubleVector.getCPtr(floatingNominal), floatingNominal, Schedule.getCPtr(fixedSchedule), fixedSchedule, DoubleVector.getCPtr(fixedRate), fixedRate, DayCounter.getCPtr(fixedDayCount), fixedDayCount, Schedule.getCPtr(floatSchedule), floatSchedule, IborIndex.getCPtr(index), index, DoubleVector.getCPtr(gearing), gearing, DoubleVector.getCPtr(spread), spread, DayCounter.getCPtr(floatDayCount), floatDayCount, intermediateCapitalExchange), true);
  }

  public NonstandardSwap(_VanillaSwap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount) {
    this(QuantLibJNI.new_NonstandardSwap__SWIG_3(type.swigValue(), DoubleVector.getCPtr(fixedNominal), fixedNominal, DoubleVector.getCPtr(floatingNominal), floatingNominal, Schedule.getCPtr(fixedSchedule), fixedSchedule, DoubleVector.getCPtr(fixedRate), fixedRate, DayCounter.getCPtr(fixedDayCount), fixedDayCount, Schedule.getCPtr(floatSchedule), floatSchedule, IborIndex.getCPtr(index), index, DoubleVector.getCPtr(gearing), gearing, DoubleVector.getCPtr(spread), spread, DayCounter.getCPtr(floatDayCount), floatDayCount), true);
  }

  public Leg fixedLeg() {
    return new Leg(QuantLibJNI.NonstandardSwap_fixedLeg(swigCPtr, this), false);
  }

  public Leg floatingLeg() {
    return new Leg(QuantLibJNI.NonstandardSwap_floatingLeg(swigCPtr, this), false);
  }

  public DoubleVector fixedNominals() {
    return new DoubleVector(QuantLibJNI.NonstandardSwap_fixedNominals(swigCPtr, this), true);
  }

  public DoubleVector floatingNominals() {
    return new DoubleVector(QuantLibJNI.NonstandardSwap_floatingNominals(swigCPtr, this), true);
  }

  public Schedule fixedSchedule() {
    return new Schedule(QuantLibJNI.NonstandardSwap_fixedSchedule(swigCPtr, this), false);
  }

  public Schedule floatingSchedule() {
    return new Schedule(QuantLibJNI.NonstandardSwap_floatingSchedule(swigCPtr, this), false);
  }

  public DoubleVector fixedRate() {
    return new DoubleVector(QuantLibJNI.NonstandardSwap_fixedRate(swigCPtr, this), true);
  }

  public DoubleVector spreads() {
    return new DoubleVector(QuantLibJNI.NonstandardSwap_spreads(swigCPtr, this), true);
  }

  public DoubleVector gearings() {
    return new DoubleVector(QuantLibJNI.NonstandardSwap_gearings(swigCPtr, this), true);
  }

  public DayCounter floatingDayCount() {
    return new DayCounter(QuantLibJNI.NonstandardSwap_floatingDayCount(swigCPtr, this), false);
  }

  public DayCounter fixedDayCount() {
    return new DayCounter(QuantLibJNI.NonstandardSwap_fixedDayCount(swigCPtr, this), false);
  }

}
