File: Bond.java

package info (click to toggle)
quantlib-swig 1.15-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 103,484 kB
  • sloc: cpp: 2,029,354; cs: 61,237; java: 45,425; perl: 27,362; python: 22,024; ruby: 989; sh: 741; makefile: 319
file content (198 lines) | stat: -rw-r--r-- 8,293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * 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 Bond extends Instrument {
  private transient long swigCPtr;

  protected Bond(long cPtr, boolean cMemoryOwn) {
    super(QuantLibJNI.Bond_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(Bond obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_Bond(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public Bond(long settlementDays, Calendar calendar, double faceAmount, Date maturityDate, Date issueDate, Leg cashflows) {
    this(QuantLibJNI.new_Bond__SWIG_0(settlementDays, Calendar.getCPtr(calendar), calendar, faceAmount, Date.getCPtr(maturityDate), maturityDate, Date.getCPtr(issueDate), issueDate, Leg.getCPtr(cashflows), cashflows), true);
  }

  public Bond(long settlementDays, Calendar calendar, double faceAmount, Date maturityDate, Date issueDate) {
    this(QuantLibJNI.new_Bond__SWIG_1(settlementDays, Calendar.getCPtr(calendar), calendar, faceAmount, Date.getCPtr(maturityDate), maturityDate, Date.getCPtr(issueDate), issueDate), true);
  }

  public Bond(long settlementDays, Calendar calendar, double faceAmount, Date maturityDate) {
    this(QuantLibJNI.new_Bond__SWIG_2(settlementDays, Calendar.getCPtr(calendar), calendar, faceAmount, Date.getCPtr(maturityDate), maturityDate), true);
  }

  public Bond(long settlementDays, Calendar calendar, Date issueDate, Leg coupons) {
    this(QuantLibJNI.new_Bond__SWIG_3(settlementDays, Calendar.getCPtr(calendar), calendar, Date.getCPtr(issueDate), issueDate, Leg.getCPtr(coupons), coupons), true);
  }

  public Bond(long settlementDays, Calendar calendar, Date issueDate) {
    this(QuantLibJNI.new_Bond__SWIG_4(settlementDays, Calendar.getCPtr(calendar), calendar, Date.getCPtr(issueDate), issueDate), true);
  }

  public Bond(long settlementDays, Calendar calendar) {
    this(QuantLibJNI.new_Bond__SWIG_5(settlementDays, Calendar.getCPtr(calendar), calendar), true);
  }

  public double nextCouponRate(Date d) {
    return QuantLibJNI.Bond_nextCouponRate__SWIG_0(swigCPtr, this, Date.getCPtr(d), d);
  }

  public double nextCouponRate() {
    return QuantLibJNI.Bond_nextCouponRate__SWIG_1(swigCPtr, this);
  }

  public double previousCouponRate(Date d) {
    return QuantLibJNI.Bond_previousCouponRate__SWIG_0(swigCPtr, this, Date.getCPtr(d), d);
  }

  public double previousCouponRate() {
    return QuantLibJNI.Bond_previousCouponRate__SWIG_1(swigCPtr, this);
  }

  public long settlementDays() {
    return QuantLibJNI.Bond_settlementDays(swigCPtr, this);
  }

  public Date settlementDate(Date d) {
    return new Date(QuantLibJNI.Bond_settlementDate__SWIG_0(swigCPtr, this, Date.getCPtr(d), d), true);
  }

  public Date settlementDate() {
    return new Date(QuantLibJNI.Bond_settlementDate__SWIG_1(swigCPtr, this), true);
  }

  public Date startDate() {
    return new Date(QuantLibJNI.Bond_startDate(swigCPtr, this), true);
  }

  public Date maturityDate() {
    return new Date(QuantLibJNI.Bond_maturityDate(swigCPtr, this), true);
  }

  public Date issueDate() {
    return new Date(QuantLibJNI.Bond_issueDate(swigCPtr, this), true);
  }

  public Leg cashflows() {
    return new Leg(QuantLibJNI.Bond_cashflows(swigCPtr, this), true);
  }

  public Leg redemptions() {
    return new Leg(QuantLibJNI.Bond_redemptions(swigCPtr, this), true);
  }

  public CashFlow redemption() {
    return new CashFlow(QuantLibJNI.Bond_redemption(swigCPtr, this), true);
  }

  public Calendar calendar() {
    return new Calendar(QuantLibJNI.Bond_calendar(swigCPtr, this), true);
  }

  public DoubleVector notionals() {
    return new DoubleVector(QuantLibJNI.Bond_notionals(swigCPtr, this), true);
  }

  public double notional(Date d) {
    return QuantLibJNI.Bond_notional__SWIG_0(swigCPtr, this, Date.getCPtr(d), d);
  }

  public double notional() {
    return QuantLibJNI.Bond_notional__SWIG_1(swigCPtr, this);
  }

  public double cleanPrice() {
    return QuantLibJNI.Bond_cleanPrice__SWIG_0(swigCPtr, this);
  }

  public double cleanPrice(double yield, DayCounter dc, Compounding compounding, Frequency frequency, Date settlement) {
    return QuantLibJNI.Bond_cleanPrice__SWIG_1(swigCPtr, this, yield, DayCounter.getCPtr(dc), dc, compounding.swigValue(), frequency.swigValue(), Date.getCPtr(settlement), settlement);
  }

  public double cleanPrice(double yield, DayCounter dc, Compounding compounding, Frequency frequency) {
    return QuantLibJNI.Bond_cleanPrice__SWIG_2(swigCPtr, this, yield, DayCounter.getCPtr(dc), dc, compounding.swigValue(), frequency.swigValue());
  }

  public double dirtyPrice() {
    return QuantLibJNI.Bond_dirtyPrice__SWIG_0(swigCPtr, this);
  }

  public double dirtyPrice(double yield, DayCounter dc, Compounding compounding, Frequency frequency, Date settlement) {
    return QuantLibJNI.Bond_dirtyPrice__SWIG_1(swigCPtr, this, yield, DayCounter.getCPtr(dc), dc, compounding.swigValue(), frequency.swigValue(), Date.getCPtr(settlement), settlement);
  }

  public double dirtyPrice(double yield, DayCounter dc, Compounding compounding, Frequency frequency) {
    return QuantLibJNI.Bond_dirtyPrice__SWIG_2(swigCPtr, this, yield, DayCounter.getCPtr(dc), dc, compounding.swigValue(), frequency.swigValue());
  }

  public double yield(DayCounter dc, Compounding compounding, Frequency freq, double accuracy, long maxEvaluations) {
    return QuantLibJNI.Bond_yield__SWIG_0(swigCPtr, this, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue(), accuracy, maxEvaluations);
  }

  public double yield(DayCounter dc, Compounding compounding, Frequency freq, double accuracy) {
    return QuantLibJNI.Bond_yield__SWIG_1(swigCPtr, this, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue(), accuracy);
  }

  public double yield(DayCounter dc, Compounding compounding, Frequency freq) {
    return QuantLibJNI.Bond_yield__SWIG_2(swigCPtr, this, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue());
  }

  public double yield(double cleanPrice, DayCounter dc, Compounding compounding, Frequency freq, Date settlement, double accuracy, long maxEvaluations) {
    return QuantLibJNI.Bond_yield__SWIG_3(swigCPtr, this, cleanPrice, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue(), Date.getCPtr(settlement), settlement, accuracy, maxEvaluations);
  }

  public double yield(double cleanPrice, DayCounter dc, Compounding compounding, Frequency freq, Date settlement, double accuracy) {
    return QuantLibJNI.Bond_yield__SWIG_4(swigCPtr, this, cleanPrice, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue(), Date.getCPtr(settlement), settlement, accuracy);
  }

  public double yield(double cleanPrice, DayCounter dc, Compounding compounding, Frequency freq, Date settlement) {
    return QuantLibJNI.Bond_yield__SWIG_5(swigCPtr, this, cleanPrice, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue(), Date.getCPtr(settlement), settlement);
  }

  public double yield(double cleanPrice, DayCounter dc, Compounding compounding, Frequency freq) {
    return QuantLibJNI.Bond_yield__SWIG_6(swigCPtr, this, cleanPrice, DayCounter.getCPtr(dc), dc, compounding.swigValue(), freq.swigValue());
  }

  public double accruedAmount(Date settlement) {
    return QuantLibJNI.Bond_accruedAmount__SWIG_0(swigCPtr, this, Date.getCPtr(settlement), settlement);
  }

  public double accruedAmount() {
    return QuantLibJNI.Bond_accruedAmount__SWIG_1(swigCPtr, this);
  }

  public double settlementValue() {
    return QuantLibJNI.Bond_settlementValue__SWIG_0(swigCPtr, this);
  }

  public double settlementValue(double cleanPrice) {
    return QuantLibJNI.Bond_settlementValue__SWIG_1(swigCPtr, this, cleanPrice);
  }

}