26
26
import java .util .Objects ;
27
27
28
28
/**
29
- * <img src= "http://www.financeformulas.net/formulaimages/APY%201.gif" />
30
- * <p>
31
29
* The Annual Percentage Yield (APY), referenced as the effective annual rate in finance,
32
30
* is the rate of interest that is earned when taking into consideration the effect of
33
31
* compounding.
34
32
*
35
- *
36
33
* There are various terms used when compounding is not considered including nominal interest
37
34
* rate, stated annual interest rate, and annual percentage rate(APR).
38
35
*
45
42
*
46
43
* @author Anatole Tresch
47
44
* @author Werner Keil
48
- * @link http://www.financeformulas.net/Compound_Interest.html
45
+ * @see <a href=" http://www.financeformulas.net/Compound_Interest.html">http://www.financeformulas.net/Compound_Interest.html</a>
49
46
*/
50
47
public final class AnnualPercentageYield implements MonetaryOperator {
51
48
@@ -54,7 +51,7 @@ public final class AnnualPercentageYield implements MonetaryOperator {
54
51
*/
55
52
private final Rate rate ;
56
53
/**
57
- * the periods, > = 0.
54
+ * the periods, > = 0.
58
55
*/
59
56
private final int periods ;
60
57
@@ -63,7 +60,7 @@ public final class AnnualPercentageYield implements MonetaryOperator {
63
60
* Private constructor.
64
61
*
65
62
* @param rate the target rate, not null.
66
- * @param periods the periods, > = 0.
63
+ * @param periods the periods, > = 0.
67
64
*/
68
65
private AnnualPercentageYield (Rate rate , int periods ) {
69
66
this .rate = Objects .requireNonNull (rate );
@@ -73,10 +70,20 @@ private AnnualPercentageYield(Rate rate, int periods) {
73
70
this .periods = periods ;
74
71
}
75
72
73
+ /**
74
+ * Gets periods.
75
+ *
76
+ * @return the periods
77
+ */
76
78
public int getPeriods () {
77
79
return periods ;
78
80
}
79
81
82
+ /**
83
+ * Gets rate.
84
+ *
85
+ * @return the rate
86
+ */
80
87
public Rate getRate () {
81
88
return rate ;
82
89
}
@@ -86,7 +93,7 @@ public Rate getRate() {
86
93
* Access a MonetaryOperator for calculation.
87
94
*
88
95
* @param rate the target rate, not null.
89
- * @param periods the periods, > = 0.
96
+ * @param periods the periods, > = 0.
90
97
* @return the operator, never null.
91
98
*/
92
99
public static AnnualPercentageYield of (Rate rate , int periods ){
@@ -97,7 +104,7 @@ public static AnnualPercentageYield of(Rate rate, int periods){
97
104
* Performs the calculation.
98
105
*
99
106
* @param rate the target rate, not null.
100
- * @param periods the periods, > = 0.
107
+ * @param periods the periods, > = 0.
101
108
* @return the resulting amount, never null.
102
109
*/
103
110
public static Rate calculate (Rate rate , int periods ) {
@@ -116,7 +123,7 @@ public static Rate calculate(Rate rate, int periods) {
116
123
*
117
124
* @param amount the base amount, not null.
118
125
* @param rate the target rate, not null.
119
- * @param periods the periods, > = 0.
126
+ * @param periods the periods, > = 0.
120
127
* @return the resulting amount, never null.
121
128
*/
122
129
public static MonetaryAmount calculate (MonetaryAmount amount , Rate rate , int periods ) {
0 commit comments