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 EquityTotalReturnSwap extends Swap implements org.quantlib.helpers.QuantLibJNIHelpers.AutoCloseable {
012  private transient long swigCPtr;
013  private transient boolean swigCMemOwnDerived;
014
015  protected EquityTotalReturnSwap(long cPtr, boolean cMemoryOwn) {
016    super(QuantLibJNI.EquityTotalReturnSwap_SWIGSmartPtrUpcast(cPtr), true);
017    swigCMemOwnDerived = cMemoryOwn;
018    swigCPtr = cPtr;
019  }
020
021  protected static long getCPtr(EquityTotalReturnSwap 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_EquityTotalReturnSwap(swigCPtr);
040      }
041      swigCPtr = 0;
042    }
043    super.delete();
044  }
045
046  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, IborIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar, BusinessDayConvention paymentConvention, long paymentDelay) {
047    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_0(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, IborIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar, paymentConvention.swigValue(), paymentDelay), true);
048  }
049
050  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, IborIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar, BusinessDayConvention paymentConvention) {
051    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_1(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, IborIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar, paymentConvention.swigValue()), true);
052  }
053
054  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, IborIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar) {
055    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_2(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, IborIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar), true);
056  }
057
058  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, IborIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing) {
059    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_3(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, IborIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing), true);
060  }
061
062  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, IborIndex interestRateIndex, DayCounter dayCounter, double margin) {
063    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_4(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, IborIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin), true);
064  }
065
066  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, OvernightIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar, BusinessDayConvention paymentConvention, long paymentDelay) {
067    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_5(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, OvernightIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar, paymentConvention.swigValue(), paymentDelay), true);
068  }
069
070  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, OvernightIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar, BusinessDayConvention paymentConvention) {
071    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_6(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, OvernightIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar, paymentConvention.swigValue()), true);
072  }
073
074  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, OvernightIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing, Calendar paymentCalendar) {
075    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_7(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, OvernightIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing, Calendar.getCPtr(paymentCalendar), paymentCalendar), true);
076  }
077
078  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, OvernightIndex interestRateIndex, DayCounter dayCounter, double margin, double gearing) {
079    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_8(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, OvernightIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin, gearing), true);
080  }
081
082  public EquityTotalReturnSwap(Swap.Type type, double nominal, Schedule schedule, EquityIndex equityIndex, OvernightIndex interestRateIndex, DayCounter dayCounter, double margin) {
083    this(QuantLibJNI.new_EquityTotalReturnSwap__SWIG_9(type.swigValue(), nominal, Schedule.getCPtr(schedule), schedule, EquityIndex.getCPtr(equityIndex), equityIndex, OvernightIndex.getCPtr(interestRateIndex), interestRateIndex, DayCounter.getCPtr(dayCounter), dayCounter, margin), true);
084  }
085
086  public Swap.Type type() {
087    return Swap.Type.swigToEnum(QuantLibJNI.EquityTotalReturnSwap_type(swigCPtr, this));
088  }
089
090  public double nominal() {
091    return QuantLibJNI.EquityTotalReturnSwap_nominal(swigCPtr, this);
092  }
093
094  public EquityIndex equityIndex() {
095    long cPtr = QuantLibJNI.EquityTotalReturnSwap_equityIndex(swigCPtr, this);
096    return (cPtr == 0) ? null : new EquityIndex(cPtr, true);
097  }
098
099  public InterestRateIndex interestRateIndex() {
100    long cPtr = QuantLibJNI.EquityTotalReturnSwap_interestRateIndex(swigCPtr, this);
101    return (cPtr == 0) ? null : new InterestRateIndex(cPtr, true);
102  }
103
104  public Schedule schedule() {
105    return new Schedule(QuantLibJNI.EquityTotalReturnSwap_schedule(swigCPtr, this), false);
106  }
107
108  public DayCounter dayCounter() {
109    return new DayCounter(QuantLibJNI.EquityTotalReturnSwap_dayCounter(swigCPtr, this), false);
110  }
111
112  public double margin() {
113    return QuantLibJNI.EquityTotalReturnSwap_margin(swigCPtr, this);
114  }
115
116  public double gearing() {
117    return QuantLibJNI.EquityTotalReturnSwap_gearing(swigCPtr, this);
118  }
119
120  public Calendar paymentCalendar() {
121    return new Calendar(QuantLibJNI.EquityTotalReturnSwap_paymentCalendar(swigCPtr, this), false);
122  }
123
124  public BusinessDayConvention paymentConvention() {
125    return BusinessDayConvention.swigToEnum(QuantLibJNI.EquityTotalReturnSwap_paymentConvention(swigCPtr, this));
126  }
127
128  public long paymentDelay() {
129    return QuantLibJNI.EquityTotalReturnSwap_paymentDelay(swigCPtr, this);
130  }
131
132  public Leg equityLeg() {
133    return new Leg(QuantLibJNI.EquityTotalReturnSwap_equityLeg(swigCPtr, this), false);
134  }
135
136  public Leg interestRateLeg() {
137    return new Leg(QuantLibJNI.EquityTotalReturnSwap_interestRateLeg(swigCPtr, this), false);
138  }
139
140  public double equityLegNPV() {
141    return QuantLibJNI.EquityTotalReturnSwap_equityLegNPV(swigCPtr, this);
142  }
143
144  public double interestRateLegNPV() {
145    return QuantLibJNI.EquityTotalReturnSwap_interestRateLegNPV(swigCPtr, this);
146  }
147
148  public double fairMargin() {
149    return QuantLibJNI.EquityTotalReturnSwap_fairMargin(swigCPtr, this);
150  }
151
152}