org.quantlib.LinearTsrPricerSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quantlib Show documentation
Show all versions of quantlib Show documentation
Java language binding for QuantLib
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (https://www.swig.org).
* Version 4.2.1
*
* 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 LinearTsrPricerSettings implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
private transient long swigCPtr;
protected transient boolean swigCMemOwn;
protected LinearTsrPricerSettings(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}
protected static long getCPtr(LinearTsrPricerSettings obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
protected static long swigRelease(LinearTsrPricerSettings obj) {
long ptr = 0;
if (obj != null) {
if (!obj.swigCMemOwn)
throw new RuntimeException("Cannot release ownership as memory is not owned");
ptr = obj.swigCPtr;
obj.swigCMemOwn = false;
obj.delete();
}
return ptr;
}
@SuppressWarnings({"deprecation", "removal"})
protected void finalize() {
delete();
}
public synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
QuantLibJNI.delete_LinearTsrPricerSettings(swigCPtr);
}
swigCPtr = 0;
}
}
public LinearTsrPricerSettings() {
this(QuantLibJNI.new_LinearTsrPricerSettings(), true);
}
public LinearTsrPricerSettings withRateBound(double lowerRateBound, double upperRateBound) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withRateBound__SWIG_0(swigCPtr, this, lowerRateBound, upperRateBound), false);
}
public LinearTsrPricerSettings withRateBound(double lowerRateBound) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withRateBound__SWIG_1(swigCPtr, this, lowerRateBound), false);
}
public LinearTsrPricerSettings withRateBound() {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withRateBound__SWIG_2(swigCPtr, this), false);
}
public LinearTsrPricerSettings withVegaRatio(double vegaRatio) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withVegaRatio__SWIG_0(swigCPtr, this, vegaRatio), false);
}
public LinearTsrPricerSettings withVegaRatio() {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withVegaRatio__SWIG_1(swigCPtr, this), false);
}
public LinearTsrPricerSettings withVegaRatio(double vegaRatio, double lowerRateBound, double upperRateBound) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withVegaRatio__SWIG_2(swigCPtr, this, vegaRatio, lowerRateBound, upperRateBound), false);
}
public LinearTsrPricerSettings withPriceThreshold(double priceThreshold) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withPriceThreshold__SWIG_0(swigCPtr, this, priceThreshold), false);
}
public LinearTsrPricerSettings withPriceThreshold() {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withPriceThreshold__SWIG_1(swigCPtr, this), false);
}
public LinearTsrPricerSettings withPriceThreshold(double priceThreshold, double lowerRateBound, double upperRateBound) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withPriceThreshold__SWIG_2(swigCPtr, this, priceThreshold, lowerRateBound, upperRateBound), false);
}
public LinearTsrPricerSettings withBSStdDevs(double stdDevs) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withBSStdDevs__SWIG_0(swigCPtr, this, stdDevs), false);
}
public LinearTsrPricerSettings withBSStdDevs() {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withBSStdDevs__SWIG_1(swigCPtr, this), false);
}
public LinearTsrPricerSettings withBSStdDevs(double stdDevs, double lowerRateBound, double upperRateBound) {
return new LinearTsrPricerSettings(QuantLibJNI.LinearTsrPricerSettings_withBSStdDevs__SWIG_2(swigCPtr, this, stdDevs, lowerRateBound, upperRateBound), false);
}
public final static class Strategy {
public final static LinearTsrPricerSettings.Strategy RateBound = new LinearTsrPricerSettings.Strategy("RateBound");
public final static LinearTsrPricerSettings.Strategy VegaRatio = new LinearTsrPricerSettings.Strategy("VegaRatio");
public final static LinearTsrPricerSettings.Strategy PriceThreshold = new LinearTsrPricerSettings.Strategy("PriceThreshold");
public final static LinearTsrPricerSettings.Strategy BSStdDevs = new LinearTsrPricerSettings.Strategy("BSStdDevs");
public final int swigValue() {
return swigValue;
}
public String toString() {
return swigName;
}
public static Strategy swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];
throw new IllegalArgumentException("No enum " + Strategy.class + " with value " + swigValue);
}
private Strategy(String swigName) {
this.swigName = swigName;
this.swigValue = swigNext++;
}
private Strategy(String swigName, int swigValue) {
this.swigName = swigName;
this.swigValue = swigValue;
swigNext = swigValue+1;
}
private Strategy(String swigName, Strategy swigEnum) {
this.swigName = swigName;
this.swigValue = swigEnum.swigValue;
swigNext = this.swigValue+1;
}
private static Strategy[] swigValues = { RateBound, VegaRatio, PriceThreshold, BSStdDevs };
private static int swigNext = 0;
private final int swigValue;
private final String swigName;
}
}