001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (https://www.swig.org). 003 * Version 4.1.1 004 * 005 * Do not make changes to this file unless you know what you are doing - modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.quantlib; 010 011public class NonstandardSwap extends Swap implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwnDerived; 014 015 protected NonstandardSwap(long cPtr, boolean cMemoryOwn) { 016 super(QuantLibJNI.NonstandardSwap_SWIGSmartPtrUpcast(cPtr), true); 017 swigCMemOwnDerived = cMemoryOwn; 018 swigCPtr = cPtr; 019 } 020 021 protected static long getCPtr(NonstandardSwap obj) { 022 return (obj == null) ? 0 : obj.swigCPtr; 023 } 024 025 protected void swigSetCMemOwn(boolean own) { 026 swigCMemOwnDerived = own; 027 super.swigSetCMemOwn(own); 028 } 029 030 @SuppressWarnings("deprecation") 031 protected void finalize() { 032 delete(); 033 } 034 035 public synchronized void delete() { 036 if (swigCPtr != 0) { 037 if (swigCMemOwnDerived) { 038 swigCMemOwnDerived = false; 039 QuantLibJNI.delete_NonstandardSwap(swigCPtr); 040 } 041 swigCPtr = 0; 042 } 043 super.delete(); 044 } 045 046 public NonstandardSwap(Swap.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) { 047 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); 048 } 049 050 public NonstandardSwap(Swap.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) { 051 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); 052 } 053 054 public NonstandardSwap(Swap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount, boolean intermediateCapitalExchange) { 055 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); 056 } 057 058 public NonstandardSwap(Swap.Type type, DoubleVector fixedNominal, DoubleVector floatingNominal, Schedule fixedSchedule, DoubleVector fixedRate, DayCounter fixedDayCount, Schedule floatSchedule, IborIndex index, DoubleVector gearing, DoubleVector spread, DayCounter floatDayCount) { 059 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); 060 } 061 062 public Swap.Type type() { 063 return Swap.Type.swigToEnum(QuantLibJNI.NonstandardSwap_type(swigCPtr, this)); 064 } 065 066 public DoubleVector fixedNominal() { 067 return new DoubleVector(QuantLibJNI.NonstandardSwap_fixedNominal(swigCPtr, this), false); 068 } 069 070 public DoubleVector floatingNominal() { 071 return new DoubleVector(QuantLibJNI.NonstandardSwap_floatingNominal(swigCPtr, this), false); 072 } 073 074 public Schedule fixedSchedule() { 075 return new Schedule(QuantLibJNI.NonstandardSwap_fixedSchedule(swigCPtr, this), false); 076 } 077 078 public DoubleVector fixedRate() { 079 return new DoubleVector(QuantLibJNI.NonstandardSwap_fixedRate(swigCPtr, this), false); 080 } 081 082 public DayCounter fixedDayCount() { 083 return new DayCounter(QuantLibJNI.NonstandardSwap_fixedDayCount(swigCPtr, this), false); 084 } 085 086 public Schedule floatingSchedule() { 087 return new Schedule(QuantLibJNI.NonstandardSwap_floatingSchedule(swigCPtr, this), false); 088 } 089 090 public IborIndex iborIndex() { 091 long cPtr = QuantLibJNI.NonstandardSwap_iborIndex(swigCPtr, this); 092 return (cPtr == 0) ? null : new IborIndex(cPtr, true); 093 } 094 095 public double spread() { 096 return QuantLibJNI.NonstandardSwap_spread(swigCPtr, this); 097 } 098 099 public double gearing() { 100 return QuantLibJNI.NonstandardSwap_gearing(swigCPtr, this); 101 } 102 103 public DoubleVector spreads() { 104 return new DoubleVector(QuantLibJNI.NonstandardSwap_spreads(swigCPtr, this), false); 105 } 106 107 public DoubleVector gearings() { 108 return new DoubleVector(QuantLibJNI.NonstandardSwap_gearings(swigCPtr, this), false); 109 } 110 111 public DayCounter floatingDayCount() { 112 return new DayCounter(QuantLibJNI.NonstandardSwap_floatingDayCount(swigCPtr, this), false); 113 } 114 115 public BusinessDayConvention paymentConvention() { 116 return BusinessDayConvention.swigToEnum(QuantLibJNI.NonstandardSwap_paymentConvention(swigCPtr, this)); 117 } 118 119 public Leg fixedLeg() { 120 return new Leg(QuantLibJNI.NonstandardSwap_fixedLeg(swigCPtr, this), false); 121 } 122 123 public Leg floatingLeg() { 124 return new Leg(QuantLibJNI.NonstandardSwap_floatingLeg(swigCPtr, this), false); 125 } 126 127}