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 MakeOIS implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  protected transient boolean swigCMemOwn;
014
015  protected MakeOIS(long cPtr, boolean cMemoryOwn) {
016    swigCMemOwn = cMemoryOwn;
017    swigCPtr = cPtr;
018  }
019
020  protected static long getCPtr(MakeOIS obj) {
021    return (obj == null) ? 0 : obj.swigCPtr;
022  }
023
024  protected static long swigRelease(MakeOIS 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_MakeOIS(swigCPtr);
046      }
047      swigCPtr = 0;
048    }
049  }
050
051  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double fixedRate, Period fwdStart) {
052    this(QuantLibJNI.new_MakeOIS__SWIG_0(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex, fixedRate, Period.getCPtr(fwdStart), fwdStart), true);
053  }
054
055  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double fixedRate) {
056    this(QuantLibJNI.new_MakeOIS__SWIG_1(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex, fixedRate), true);
057  }
058
059  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex) {
060    this(QuantLibJNI.new_MakeOIS__SWIG_2(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex), true);
061  }
062
063  public OvernightIndexedSwap makeOIS() {
064    long cPtr = QuantLibJNI.MakeOIS_makeOIS(swigCPtr, this);
065    return (cPtr == 0) ? null : new OvernightIndexedSwap(cPtr, true);
066  }
067
068  public MakeOIS receiveFixed(boolean flag) {
069    return new MakeOIS(QuantLibJNI.MakeOIS_receiveFixed__SWIG_0(swigCPtr, this, flag), false);
070  }
071
072  public MakeOIS receiveFixed() {
073    return new MakeOIS(QuantLibJNI.MakeOIS_receiveFixed__SWIG_1(swigCPtr, this), false);
074  }
075
076  public MakeOIS withType(Swap.Type type) {
077    return new MakeOIS(QuantLibJNI.MakeOIS_withType(swigCPtr, this, type.swigValue()), false);
078  }
079
080  public MakeOIS withNominal(double n) {
081    return new MakeOIS(QuantLibJNI.MakeOIS_withNominal(swigCPtr, this, n), false);
082  }
083
084  public MakeOIS withSettlementDays(long settlementDays) {
085    return new MakeOIS(QuantLibJNI.MakeOIS_withSettlementDays(swigCPtr, this, settlementDays), false);
086  }
087
088  public MakeOIS withEffectiveDate(Date arg0) {
089    return new MakeOIS(QuantLibJNI.MakeOIS_withEffectiveDate(swigCPtr, this, Date.getCPtr(arg0), arg0), false);
090  }
091
092  public MakeOIS withTerminationDate(Date arg0) {
093    return new MakeOIS(QuantLibJNI.MakeOIS_withTerminationDate(swigCPtr, this, Date.getCPtr(arg0), arg0), false);
094  }
095
096  public MakeOIS withRule(DateGeneration.Rule r) {
097    return new MakeOIS(QuantLibJNI.MakeOIS_withRule(swigCPtr, this, r.swigValue()), false);
098  }
099
100  public MakeOIS withPaymentFrequency(Frequency f) {
101    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentFrequency(swigCPtr, this, f.swigValue()), false);
102  }
103
104  public MakeOIS withPaymentAdjustment(BusinessDayConvention convention) {
105    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentAdjustment(swigCPtr, this, convention.swigValue()), false);
106  }
107
108  public MakeOIS withPaymentLag(long lag) {
109    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentLag(swigCPtr, this, lag), false);
110  }
111
112  public MakeOIS withPaymentCalendar(Calendar cal) {
113    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentCalendar(swigCPtr, this, Calendar.getCPtr(cal), cal), false);
114  }
115
116  public MakeOIS withEndOfMonth(boolean flag) {
117    return new MakeOIS(QuantLibJNI.MakeOIS_withEndOfMonth__SWIG_0(swigCPtr, this, flag), false);
118  }
119
120  public MakeOIS withEndOfMonth() {
121    return new MakeOIS(QuantLibJNI.MakeOIS_withEndOfMonth__SWIG_1(swigCPtr, this), false);
122  }
123
124  public MakeOIS withFixedLegDayCount(DayCounter dc) {
125    return new MakeOIS(QuantLibJNI.MakeOIS_withFixedLegDayCount(swigCPtr, this, DayCounter.getCPtr(dc), dc), false);
126  }
127
128  public MakeOIS withOvernightLegSpread(double sp) {
129    return new MakeOIS(QuantLibJNI.MakeOIS_withOvernightLegSpread(swigCPtr, this, sp), false);
130  }
131
132  public MakeOIS withDiscountingTermStructure(YieldTermStructureHandle discountingTermStructure) {
133    return new MakeOIS(QuantLibJNI.MakeOIS_withDiscountingTermStructure(swigCPtr, this, YieldTermStructureHandle.getCPtr(discountingTermStructure), discountingTermStructure), false);
134  }
135
136  public MakeOIS withTelescopicValueDates(boolean telescopicValueDates) {
137    return new MakeOIS(QuantLibJNI.MakeOIS_withTelescopicValueDates(swigCPtr, this, telescopicValueDates), false);
138  }
139
140  public MakeOIS withAveragingMethod(RateAveraging.Type averagingMethod) {
141    return new MakeOIS(QuantLibJNI.MakeOIS_withAveragingMethod(swigCPtr, this, averagingMethod.swigValue()), false);
142  }
143
144  public MakeOIS withPricingEngine(PricingEngine engine) {
145    return new MakeOIS(QuantLibJNI.MakeOIS_withPricingEngine(swigCPtr, this, PricingEngine.getCPtr(engine), engine), false);
146  }
147
148}