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 SwaptionVolatilityStructureHandle implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 protected transient boolean swigCMemOwn; 014 015 protected SwaptionVolatilityStructureHandle(long cPtr, boolean cMemoryOwn) { 016 swigCMemOwn = cMemoryOwn; 017 swigCPtr = cPtr; 018 } 019 020 protected static long getCPtr(SwaptionVolatilityStructureHandle obj) { 021 return (obj == null) ? 0 : obj.swigCPtr; 022 } 023 024 protected static long swigRelease(SwaptionVolatilityStructureHandle obj) { 025 long ptr = 0; 026 if (obj != null) { 027 if (!obj.swigCMemOwn) 028 throw new RuntimeException("Cannot release ownership as memory is not owned"); 029 ptr = obj.swigCPtr; 030 obj.swigCMemOwn = false; 031 obj.delete(); 032 } 033 return ptr; 034 } 035 036 @SuppressWarnings("deprecation") 037 protected void finalize() { 038 delete(); 039 } 040 041 public synchronized void delete() { 042 if (swigCPtr != 0) { 043 if (swigCMemOwn) { 044 swigCMemOwn = false; 045 QuantLibJNI.delete_SwaptionVolatilityStructureHandle(swigCPtr); 046 } 047 swigCPtr = 0; 048 } 049 } 050 051 public SwaptionVolatilityStructureHandle(SwaptionVolatilityStructure arg0) { 052 this(QuantLibJNI.new_SwaptionVolatilityStructureHandle__SWIG_0(SwaptionVolatilityStructure.getCPtr(arg0), arg0), true); 053 } 054 055 public SwaptionVolatilityStructureHandle() { 056 this(QuantLibJNI.new_SwaptionVolatilityStructureHandle__SWIG_1(), true); 057 } 058 059 public SwaptionVolatilityStructure __deref__() { 060 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle___deref__(swigCPtr, this); 061 return (cPtr == 0) ? null : new SwaptionVolatilityStructure(cPtr, true); 062 } 063 064 public SwaptionVolatilityStructure currentLink() { 065 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_currentLink(swigCPtr, this); 066 return (cPtr == 0) ? null : new SwaptionVolatilityStructure(cPtr, true); 067 } 068 069 public boolean empty() { 070 return QuantLibJNI.SwaptionVolatilityStructureHandle_empty(swigCPtr, this); 071 } 072 073 public Observable asObservable() { 074 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_asObservable(swigCPtr, this); 075 return (cPtr == 0) ? null : new Observable(cPtr, true); 076 } 077 078 public double volatility(Date start, Period length, double strike, boolean extrapolate) { 079 return QuantLibJNI.SwaptionVolatilityStructureHandle_volatility__SWIG_0(swigCPtr, this, Date.getCPtr(start), start, Period.getCPtr(length), length, strike, extrapolate); 080 } 081 082 public double volatility(Date start, Period length, double strike) { 083 return QuantLibJNI.SwaptionVolatilityStructureHandle_volatility__SWIG_1(swigCPtr, this, Date.getCPtr(start), start, Period.getCPtr(length), length, strike); 084 } 085 086 public double volatility(double start, double length, double strike, boolean extrapolate) { 087 return QuantLibJNI.SwaptionVolatilityStructureHandle_volatility__SWIG_2(swigCPtr, this, start, length, strike, extrapolate); 088 } 089 090 public double volatility(double start, double length, double strike) { 091 return QuantLibJNI.SwaptionVolatilityStructureHandle_volatility__SWIG_3(swigCPtr, this, start, length, strike); 092 } 093 094 public double blackVariance(Date start, Period length, double strike, boolean extrapolate) { 095 return QuantLibJNI.SwaptionVolatilityStructureHandle_blackVariance__SWIG_0(swigCPtr, this, Date.getCPtr(start), start, Period.getCPtr(length), length, strike, extrapolate); 096 } 097 098 public double blackVariance(Date start, Period length, double strike) { 099 return QuantLibJNI.SwaptionVolatilityStructureHandle_blackVariance__SWIG_1(swigCPtr, this, Date.getCPtr(start), start, Period.getCPtr(length), length, strike); 100 } 101 102 public double blackVariance(double start, double length, double strike, boolean extrapolate) { 103 return QuantLibJNI.SwaptionVolatilityStructureHandle_blackVariance__SWIG_2(swigCPtr, this, start, length, strike, extrapolate); 104 } 105 106 public double blackVariance(double start, double length, double strike) { 107 return QuantLibJNI.SwaptionVolatilityStructureHandle_blackVariance__SWIG_3(swigCPtr, this, start, length, strike); 108 } 109 110 public Date optionDateFromTenor(Period p) { 111 return new Date(QuantLibJNI.SwaptionVolatilityStructureHandle_optionDateFromTenor(swigCPtr, this, Period.getCPtr(p), p), true); 112 } 113 114 public double shift(Period optionTenor, Period swapTenor, boolean extrapolate) { 115 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_0(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, Period.getCPtr(swapTenor), swapTenor, extrapolate); 116 } 117 118 public double shift(Period optionTenor, Period swapTenor) { 119 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_1(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, Period.getCPtr(swapTenor), swapTenor); 120 } 121 122 public double shift(Date optionDate, Period swapTenor, boolean extrapolate) { 123 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_2(swigCPtr, this, Date.getCPtr(optionDate), optionDate, Period.getCPtr(swapTenor), swapTenor, extrapolate); 124 } 125 126 public double shift(Date optionDate, Period swapTenor) { 127 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_3(swigCPtr, this, Date.getCPtr(optionDate), optionDate, Period.getCPtr(swapTenor), swapTenor); 128 } 129 130 public double shift(double optionTime, Period swapTenor, boolean extrapolate) { 131 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_4(swigCPtr, this, optionTime, Period.getCPtr(swapTenor), swapTenor, extrapolate); 132 } 133 134 public double shift(double optionTime, Period swapTenor) { 135 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_5(swigCPtr, this, optionTime, Period.getCPtr(swapTenor), swapTenor); 136 } 137 138 public double shift(Period optionTenor, double swapLength, boolean extrapolate) { 139 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_6(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, swapLength, extrapolate); 140 } 141 142 public double shift(Period optionTenor, double swapLength) { 143 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_7(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, swapLength); 144 } 145 146 public double shift(Date optionDate, double swapLength, boolean extrapolate) { 147 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_8(swigCPtr, this, Date.getCPtr(optionDate), optionDate, swapLength, extrapolate); 148 } 149 150 public double shift(Date optionDate, double swapLength) { 151 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_9(swigCPtr, this, Date.getCPtr(optionDate), optionDate, swapLength); 152 } 153 154 public double shift(double optionTime, double swapLength, boolean extrapolate) { 155 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_10(swigCPtr, this, optionTime, swapLength, extrapolate); 156 } 157 158 public double shift(double optionTime, double swapLength) { 159 return QuantLibJNI.SwaptionVolatilityStructureHandle_shift__SWIG_11(swigCPtr, this, optionTime, swapLength); 160 } 161 162 public SmileSection smileSection(Period optionTenor, Period swapTenor, boolean extr) { 163 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_0(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, Period.getCPtr(swapTenor), swapTenor, extr); 164 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 165 } 166 167 public SmileSection smileSection(Period optionTenor, Period swapTenor) { 168 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_1(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, Period.getCPtr(swapTenor), swapTenor); 169 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 170 } 171 172 public SmileSection smileSection(Date optionDate, Period swapTenor, boolean extr) { 173 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_2(swigCPtr, this, Date.getCPtr(optionDate), optionDate, Period.getCPtr(swapTenor), swapTenor, extr); 174 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 175 } 176 177 public SmileSection smileSection(Date optionDate, Period swapTenor) { 178 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_3(swigCPtr, this, Date.getCPtr(optionDate), optionDate, Period.getCPtr(swapTenor), swapTenor); 179 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 180 } 181 182 public SmileSection smileSection(double optionTime, Period swapTenor, boolean extr) { 183 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_4(swigCPtr, this, optionTime, Period.getCPtr(swapTenor), swapTenor, extr); 184 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 185 } 186 187 public SmileSection smileSection(double optionTime, Period swapTenor) { 188 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_5(swigCPtr, this, optionTime, Period.getCPtr(swapTenor), swapTenor); 189 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 190 } 191 192 public SmileSection smileSection(Period optionTenor, double swapLength, boolean extr) { 193 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_6(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, swapLength, extr); 194 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 195 } 196 197 public SmileSection smileSection(Period optionTenor, double swapLength) { 198 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_7(swigCPtr, this, Period.getCPtr(optionTenor), optionTenor, swapLength); 199 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 200 } 201 202 public SmileSection smileSection(Date optionDate, double swapLength, boolean extr) { 203 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_8(swigCPtr, this, Date.getCPtr(optionDate), optionDate, swapLength, extr); 204 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 205 } 206 207 public SmileSection smileSection(Date optionDate, double swapLength) { 208 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_9(swigCPtr, this, Date.getCPtr(optionDate), optionDate, swapLength); 209 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 210 } 211 212 public SmileSection smileSection(double optionTime, double swapLength, boolean extr) { 213 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_10(swigCPtr, this, optionTime, swapLength, extr); 214 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 215 } 216 217 public SmileSection smileSection(double optionTime, double swapLength) { 218 long cPtr = QuantLibJNI.SwaptionVolatilityStructureHandle_smileSection__SWIG_11(swigCPtr, this, optionTime, swapLength); 219 return (cPtr == 0) ? null : new SmileSection(cPtr, true); 220 } 221 222 public double minStrike() { 223 return QuantLibJNI.SwaptionVolatilityStructureHandle_minStrike(swigCPtr, this); 224 } 225 226 public double maxStrike() { 227 return QuantLibJNI.SwaptionVolatilityStructureHandle_maxStrike(swigCPtr, this); 228 } 229 230 public DayCounter dayCounter() { 231 return new DayCounter(QuantLibJNI.SwaptionVolatilityStructureHandle_dayCounter(swigCPtr, this), true); 232 } 233 234 public double timeFromReference(Date date) { 235 return QuantLibJNI.SwaptionVolatilityStructureHandle_timeFromReference(swigCPtr, this, Date.getCPtr(date), date); 236 } 237 238 public Calendar calendar() { 239 return new Calendar(QuantLibJNI.SwaptionVolatilityStructureHandle_calendar(swigCPtr, this), true); 240 } 241 242 public Date referenceDate() { 243 return new Date(QuantLibJNI.SwaptionVolatilityStructureHandle_referenceDate(swigCPtr, this), true); 244 } 245 246 public Date maxDate() { 247 return new Date(QuantLibJNI.SwaptionVolatilityStructureHandle_maxDate(swigCPtr, this), true); 248 } 249 250 public double maxTime() { 251 return QuantLibJNI.SwaptionVolatilityStructureHandle_maxTime(swigCPtr, this); 252 } 253 254 public void enableExtrapolation() { 255 QuantLibJNI.SwaptionVolatilityStructureHandle_enableExtrapolation(swigCPtr, this); 256 } 257 258 public void disableExtrapolation() { 259 QuantLibJNI.SwaptionVolatilityStructureHandle_disableExtrapolation(swigCPtr, this); 260 } 261 262 public boolean allowsExtrapolation() { 263 return QuantLibJNI.SwaptionVolatilityStructureHandle_allowsExtrapolation(swigCPtr, this); 264 } 265 266}