Skip to content

Commit 41008a5

Browse files
committed
Fixed javadocs.
1 parent b160e06 commit 41008a5

File tree

126 files changed

+1564
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1564
-532
lines changed

calc/src/main/java/org/javamoney/calc/CalculationContext.java

+12
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,18 @@ private CalculationContext(){
3737
init(MathContext.DECIMAL64);
3838
}
3939

40+
/**
41+
* Math context math context.
42+
*
43+
* @return the math context
44+
*/
4045
public static MathContext mathContext(){
4146
return instance.mathContext;
4247
}
4348

4449
/**
4550
* Accesses the number '1' initialized with the current {@link MathContext}.
51+
*
4652
* @return the number instance, never null.
4753
*/
4854
public static BigDecimal one() {
@@ -51,6 +57,7 @@ public static BigDecimal one() {
5157

5258
/**
5359
* Accesses the number '1' initialized with the current {@link MathContext}.
60+
*
5461
* @return the number instance, never null.
5562
*/
5663
public static BigDecimal zero() {
@@ -59,6 +66,7 @@ public static BigDecimal zero() {
5966

6067
/**
6168
* Accesses the number '10' initialized with the current {@link MathContext}.
69+
*
6270
* @return the number instance, never null.
6371
*/
6472
public static BigDecimal ten() {
@@ -67,6 +75,7 @@ public static BigDecimal ten() {
6775

6876
/**
6977
* Creates the given number initialized with the current {@link MathContext}.
78+
*
7079
* @param num the number instance.
7180
* @return the number instance, never null.
7281
*/
@@ -76,6 +85,7 @@ public static BigDecimal bigDecimal(long num) {
7685

7786
/**
7887
* Creates the given number initialized with the current {@link MathContext}.
88+
*
7989
* @param num the number instance.
8090
* @return the number instance, never null.
8191
*/
@@ -85,6 +95,7 @@ public static BigDecimal bigDecimal(double num) {
8595

8696
/**
8797
* Creates the given number initialized with the current {@link MathContext}.
98+
*
8899
* @param num the number instance.
89100
* @return the number instance, never null.
90101
*/
@@ -96,6 +107,7 @@ public static BigDecimal bigDecimal(BigDecimal num) {
96107
/**
97108
* This method allows o set the {@link MathContext} used for doing calculations.
98109
* Not te that this affects all calculations at all stages.
110+
*
99111
* @param mathContext the new match context, not null.
100112
*/
101113
public static void setMathContext(MathContext mathContext){

calc/src/main/java/org/javamoney/calc/CompositeMonetaryOperator.java

+11
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public class CompositeMonetaryOperator implements MonetaryOperator {
3737

3838
private final List<MonetaryOperator> functions = new ArrayList<>();
3939

40+
/**
41+
* Instantiates a new Composite monetary operator.
42+
*
43+
* @param operations the operations
44+
*/
4045
@SafeVarargs
4146
public CompositeMonetaryOperator(Iterable<MonetaryOperator>... operations) {
4247
if (operations != null) {
@@ -48,6 +53,12 @@ public CompositeMonetaryOperator(Iterable<MonetaryOperator>... operations) {
4853
}
4954
}
5055

56+
/**
57+
* Instantiates a new Composite monetary operator.
58+
*
59+
* @param name the name
60+
* @param operations the operations
61+
*/
5162
public CompositeMonetaryOperator(String name, MonetaryOperator... operations) {
5263
Objects.requireNonNull(name);
5364
Collections.addAll(functions, operations);

calc/src/main/java/org/javamoney/calc/ValidatedAmount.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* <ul>
3232
* <li>immutable</li>
3333
* <li>final</li>
34-
* <li>thread-safe/li>
34+
* <li>thread-safe</li>
3535
* <li>serializable</li>
3636
* </ul>
3737
*
@@ -60,9 +60,9 @@ public static MonetaryAmount unsignedAmount(MonetaryAmount amount) {
6060
* Creates an predicated {@link MonetaryAmount} based on the given
6161
* {@link MonetaryAmount}.
6262
*
63-
* @param amount The amount to decorated.
64-
* @return a predicated instance, that ensures the given predicate is always
65-
* ensured on all operations.
63+
* @param amount The amount to decorated.
64+
* @param predicate the predicate
65+
* @return a predicated instance, that ensures the given predicate is always ensured on all operations.
6666
*/
6767
public static MonetaryAmount of(MonetaryAmount amount,
6868
Predicate<MonetaryAmount> predicate) {

calc/src/main/java/org/javamoney/calc/ValidatedMoney.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ final class ValidatedMoney implements
5454
/**
5555
* Creates a new wrapper instance.
5656
*
57-
* @param amount the underlying amount, not null and not negative.
57+
* @param amount the underlying amount, not null and not negative.
58+
* @param predicate the predicate
5859
* @throws IllegalArgumentException if the amount passed is negative.
5960
*/
6061
ValidatedMoney(MonetaryAmount amount,
@@ -74,7 +75,7 @@ final class ValidatedMoney implements
7475
}
7576

7677
/**
77-
* Access an {@link ValidatedMoney} based on the given
78+
* Access an ValidatedMoney based on the given
7879
* {@link MonetaryAmount}.
7980
* @param predicate the validation function, not null.
8081
* @param amount the amount to decorate
@@ -406,6 +407,11 @@ private final class ValidatedAmountFactory implements MonetaryAmountFactory<Vali
406407
private Predicate<MonetaryAmount> predicate;
407408
private MonetaryAmountFactory<?> factory = Monetary.getDefaultAmountFactory();
408409

410+
/**
411+
* Instantiates a new Validated amount factory.
412+
*
413+
* @param amount the amount
414+
*/
409415
public ValidatedAmountFactory(ValidatedMoney amount){
410416
this.predicate = amount.predicate;
411417
}

calc/src/main/java/org/javamoney/calc/banking/AnnualPercentageYield.java

+16-9
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@
2626
import java.util.Objects;
2727

2828
/**
29-
* <img src= "http://www.financeformulas.net/formulaimages/APY%201.gif" />
30-
* <p>
3129
* The Annual Percentage Yield (APY), referenced as the effective annual rate in finance,
3230
* is the rate of interest that is earned when taking into consideration the effect of
3331
* compounding.
3432
*
35-
*
3633
* There are various terms used when compounding is not considered including nominal interest
3734
* rate, stated annual interest rate, and annual percentage rate(APR).
3835
*
@@ -45,7 +42,7 @@
4542
*
4643
* @author Anatole Tresch
4744
* @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>
4946
*/
5047
public final class AnnualPercentageYield implements MonetaryOperator {
5148

@@ -54,7 +51,7 @@ public final class AnnualPercentageYield implements MonetaryOperator {
5451
*/
5552
private final Rate rate;
5653
/**
57-
* the periods, >= 0.
54+
* the periods, &gt;= 0.
5855
*/
5956
private final int periods;
6057

@@ -63,7 +60,7 @@ public final class AnnualPercentageYield implements MonetaryOperator {
6360
* Private constructor.
6461
*
6562
* @param rate the target rate, not null.
66-
* @param periods the periods, >= 0.
63+
* @param periods the periods, &gt;= 0.
6764
*/
6865
private AnnualPercentageYield(Rate rate, int periods) {
6966
this.rate = Objects.requireNonNull(rate);
@@ -73,10 +70,20 @@ private AnnualPercentageYield(Rate rate, int periods) {
7370
this.periods = periods;
7471
}
7572

73+
/**
74+
* Gets periods.
75+
*
76+
* @return the periods
77+
*/
7678
public int getPeriods() {
7779
return periods;
7880
}
7981

82+
/**
83+
* Gets rate.
84+
*
85+
* @return the rate
86+
*/
8087
public Rate getRate() {
8188
return rate;
8289
}
@@ -86,7 +93,7 @@ public Rate getRate() {
8693
* Access a MonetaryOperator for calculation.
8794
*
8895
* @param rate the target rate, not null.
89-
* @param periods the periods, >= 0.
96+
* @param periods the periods, &gt;= 0.
9097
* @return the operator, never null.
9198
*/
9299
public static AnnualPercentageYield of(Rate rate, int periods){
@@ -97,7 +104,7 @@ public static AnnualPercentageYield of(Rate rate, int periods){
97104
* Performs the calculation.
98105
*
99106
* @param rate the target rate, not null.
100-
* @param periods the periods, >= 0.
107+
* @param periods the periods, &gt;= 0.
101108
* @return the resulting amount, never null.
102109
*/
103110
public static Rate calculate(Rate rate, int periods) {
@@ -116,7 +123,7 @@ public static Rate calculate(Rate rate, int periods) {
116123
*
117124
* @param amount the base amount, not null.
118125
* @param rate the target rate, not null.
119-
* @param periods the periods, >= 0.
126+
* @param periods the periods, &gt;= 0.
120127
* @return the resulting amount, never null.
121128
*/
122129
public static MonetaryAmount calculate(MonetaryAmount amount, Rate rate, int periods) {

calc/src/main/java/org/javamoney/calc/banking/BalloonLoanPayment.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import static org.javamoney.calc.CalculationContext.one;
3131

3232
/**
33-
* <img src= "http://www.financeformulas.net/formulaimages/Balloon%20Loan%20Payment%201.gif" />
34-
* <p>
3533
* The balloon loan payment formula is used to calculate the payments on a loan that has a balance
3634
* remaining after all periodic payments are made. Examples of loans that may use the balloon loan
3735
* payment formula would be auto leases, balloon mortgages, and any other form of loan not paid
@@ -53,7 +51,7 @@
5351
*
5452
* @author Anatole Tresch
5553
* @author Werner Keil
56-
* @link http://www.financeformulas.net/Compound_Interest.html
54+
* @see <a href="http://www.financeformulas.net/Compound_Interest.html">http://www.financeformulas.net/Compound_Interest.html</a>
5755
*/
5856
public final class BalloonLoanPayment extends AbstractRateAndPeriodBasedOperator{
5957

@@ -84,14 +82,20 @@ private BalloonLoanPayment(RateAndPeriods rateAndPeriods, MonetaryAmount balloon
8482
this.balloonAmount = Objects.requireNonNull(balloonAmount);
8583
}
8684

85+
/**
86+
* Get balloon amount monetary amount.
87+
*
88+
* @return the monetary amount
89+
*/
8790
public MonetaryAmount getBalloonAmount(){
8891
return balloonAmount;
8992
}
9093

9194
/**
9295
* Access a MonetaryOperator for calculation.
9396
*
94-
* @param rateAndPeriods the target rate and periods, not null.
97+
* @param rateAndPeriods the target rate and periods, not null.
98+
* @param balloonAmount the balloon amount
9599
* @return the operator, never null.
96100
*/
97101
public static BalloonLoanPayment of(RateAndPeriods rateAndPeriods, MonetaryAmount balloonAmount){
@@ -118,9 +122,9 @@ public String toString() {
118122
/**
119123
* Performs the calculation.
120124
*
121-
* @param amountPV the present value, not null.
122-
* @param balloonAmount the balloon amount, not null and currency compatible with {@code amountPV}.
123-
* @param rateAndPeriods the target rate and periods, not null.
125+
* @param amountPV the present value, not null.
126+
* @param balloonAmount the balloon amount, not null and currency compatible with {@code amountPV}.
127+
* @param rateAndPeriods the target rate and periods, not null.
124128
* @return the resulting amount, never null.
125129
*/
126130
public static MonetaryAmount calculate(MonetaryAmount amountPV, MonetaryAmount balloonAmount,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2012, 2018, Werner Keil, Anatole Tresch and others.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*
16+
* Contributors: @atsticks, @keilw
17+
*/
18+
19+
/**
20+
* Banking related financial calculations.
21+
*/
22+
package org.javamoney.calc.banking;

calc/src/main/java/org/javamoney/calc/common/AbstractRateAndPeriodBasedOperator.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ public abstract class AbstractRateAndPeriodBasedOperator implements MonetaryOper
3535
/**
3636
* Constructor.
3737
*
38-
* @param rateAndPeriods the target rate and periods, not null.
38+
* @param rateAndPeriods the target rate and periods, not null.
3939
*/
4040
protected AbstractRateAndPeriodBasedOperator(RateAndPeriods rateAndPeriods) {
4141
this.rateAndPeriods = Objects.requireNonNull(rateAndPeriods);
4242
}
4343

4444
/**
4545
* Get the rate and periods.
46+
*
4647
* @return the rate and periods, never null.
4748
*/
4849
public RateAndPeriods getRateAndPeriods() {
@@ -51,6 +52,7 @@ public RateAndPeriods getRateAndPeriods() {
5152

5253
/**
5354
* Get the current rate.
55+
*
5456
* @return the current rate, never null.
5557
*/
5658
public Rate getRate(){
@@ -59,7 +61,8 @@ public Rate getRate(){
5961

6062
/**
6163
* Get the current periods, never null.
62-
* @return the current periods, >= 0.
64+
*
65+
* @return the current periods, &gt;= 0.
6366
*/
6467
public int getPeriods(){
6568
return rateAndPeriods.getPeriods();

0 commit comments

Comments
 (0)