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 SmileSection extends Observable implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable { 012 private transient long swigCPtr; 013 private transient boolean swigCMemOwnDerived; 014 015 protected SmileSection(long cPtr, boolean cMemoryOwn) { 016 super(QuantLibJNI.SmileSection_SWIGSmartPtrUpcast(cPtr), true); 017 swigCMemOwnDerived = cMemoryOwn; 018 swigCPtr = cPtr; 019 } 020 021 protected static long getCPtr(SmileSection 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_SmileSection(swigCPtr); 040 } 041 swigCPtr = 0; 042 } 043 super.delete(); 044 } 045 046 public double minStrike() { 047 return QuantLibJNI.SmileSection_minStrike(swigCPtr, this); 048 } 049 050 public double maxStrike() { 051 return QuantLibJNI.SmileSection_maxStrike(swigCPtr, this); 052 } 053 054 public double atmLevel() { 055 return QuantLibJNI.SmileSection_atmLevel(swigCPtr, this); 056 } 057 058 public double variance(double strike) { 059 return QuantLibJNI.SmileSection_variance(swigCPtr, this, strike); 060 } 061 062 public double volatility(double strike) { 063 return QuantLibJNI.SmileSection_volatility__SWIG_0(swigCPtr, this, strike); 064 } 065 066 public Date exerciseDate() { 067 return new Date(QuantLibJNI.SmileSection_exerciseDate(swigCPtr, this), false); 068 } 069 070 public VolatilityType volatilityType() { 071 return VolatilityType.swigToEnum(QuantLibJNI.SmileSection_volatilityType(swigCPtr, this)); 072 } 073 074 public double shift() { 075 return QuantLibJNI.SmileSection_shift(swigCPtr, this); 076 } 077 078 public Date referenceDate() { 079 return new Date(QuantLibJNI.SmileSection_referenceDate(swigCPtr, this), false); 080 } 081 082 public double exerciseTime() { 083 return QuantLibJNI.SmileSection_exerciseTime(swigCPtr, this); 084 } 085 086 public DayCounter dayCounter() { 087 return new DayCounter(QuantLibJNI.SmileSection_dayCounter(swigCPtr, this), false); 088 } 089 090 public double optionPrice(double strike, Option.Type type, double discount) { 091 return QuantLibJNI.SmileSection_optionPrice__SWIG_0(swigCPtr, this, strike, type.swigValue(), discount); 092 } 093 094 public double optionPrice(double strike, Option.Type type) { 095 return QuantLibJNI.SmileSection_optionPrice__SWIG_1(swigCPtr, this, strike, type.swigValue()); 096 } 097 098 public double optionPrice(double strike) { 099 return QuantLibJNI.SmileSection_optionPrice__SWIG_2(swigCPtr, this, strike); 100 } 101 102 public double digitalOptionPrice(double strike, Option.Type type, double discount, double gap) { 103 return QuantLibJNI.SmileSection_digitalOptionPrice__SWIG_0(swigCPtr, this, strike, type.swigValue(), discount, gap); 104 } 105 106 public double digitalOptionPrice(double strike, Option.Type type, double discount) { 107 return QuantLibJNI.SmileSection_digitalOptionPrice__SWIG_1(swigCPtr, this, strike, type.swigValue(), discount); 108 } 109 110 public double digitalOptionPrice(double strike, Option.Type type) { 111 return QuantLibJNI.SmileSection_digitalOptionPrice__SWIG_2(swigCPtr, this, strike, type.swigValue()); 112 } 113 114 public double digitalOptionPrice(double strike) { 115 return QuantLibJNI.SmileSection_digitalOptionPrice__SWIG_3(swigCPtr, this, strike); 116 } 117 118 public double vega(double strike, double discount) { 119 return QuantLibJNI.SmileSection_vega__SWIG_0(swigCPtr, this, strike, discount); 120 } 121 122 public double vega(double strike) { 123 return QuantLibJNI.SmileSection_vega__SWIG_1(swigCPtr, this, strike); 124 } 125 126 public double density(double strike, double discount, double gap) { 127 return QuantLibJNI.SmileSection_density__SWIG_0(swigCPtr, this, strike, discount, gap); 128 } 129 130 public double density(double strike, double discount) { 131 return QuantLibJNI.SmileSection_density__SWIG_1(swigCPtr, this, strike, discount); 132 } 133 134 public double density(double strike) { 135 return QuantLibJNI.SmileSection_density__SWIG_2(swigCPtr, this, strike); 136 } 137 138 public double volatility(double strike, VolatilityType type, double shift) { 139 return QuantLibJNI.SmileSection_volatility__SWIG_1(swigCPtr, this, strike, type.swigValue(), shift); 140 } 141 142 public double volatility(double strike, VolatilityType type) { 143 return QuantLibJNI.SmileSection_volatility__SWIG_2(swigCPtr, this, strike, type.swigValue()); 144 } 145 146}