Skip to content

Commit 88de419

Browse files
committed
Updated JavaDoc (#99)
1 parent 4ac8598 commit 88de419

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

src/main/java/javax/money/MonetaryAmount.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
*
9797
* @author Anatole Tresch
9898
* @author Werner Keil
99-
* @version 1.0.1
99+
* @version 1.1
100100
* @see #with(MonetaryOperator)
101101
*/
102102
public interface MonetaryAmount extends CurrencySupplier, NumberSupplier, Comparable<MonetaryAmount>{
@@ -292,32 +292,32 @@ default boolean isZero(){
292292
int signum();
293293

294294
/**
295-
* Returns a {@code MonetaryAmount} whose value is <code>this + amount</code>, and whose scale is <code>max(this.scale(),
296-
* amount.scale()</code>.
295+
* Returns a {@code MonetaryAmount} whose value is <code>this + augend</code>, and whose scale is <code>max(this.getContext().getMaxScale(),
296+
* augend.getContext().getMaxScale())</code>.
297297
*
298-
* @param amount value to be added to this {@code MonetaryAmount}.
299-
* @return {@code this + amount}
298+
* @param augend value to be added to this {@code MonetaryAmount}.
299+
* @return {@code this + augend}
300300
* @throws ArithmeticException if the result exceeds the numeric capabilities of this implementation class, i.e.
301301
* the {@link MonetaryContext} cannot be adapted as required.
302302
*/
303-
MonetaryAmount add(MonetaryAmount amount);
303+
MonetaryAmount add(MonetaryAmount augend);
304304

305305
/**
306306
* Returns a {@code MonetaryAmount} whose value is <code>this -
307-
* amount</code>, and whose scale is <code>max(this.scale(),
308-
* subtrahend.scale()</code>.
307+
* amount</code>, and whose scale is <code>max(this.getContext().getMaxScale(),
308+
* subtrahend.getContext().getMaxScale()</code>.
309309
*
310-
* @param amount value to be subtracted from this {@code MonetaryAmount}.
311-
* @return {@code this - amount}
310+
* @param subtrahend value to be subtracted from this {@code MonetaryAmount}.
311+
* @return {@code this - subtrahend}
312312
* @throws ArithmeticException if the result exceeds the numeric capabilities of this implementation class, i.e.
313313
* the {@link MonetaryContext} cannot be adapted as required.
314314
*/
315-
MonetaryAmount subtract(MonetaryAmount amount);
315+
MonetaryAmount subtract(MonetaryAmount subtrahend);
316316

317317
/**
318318
* Returns a {@code MonetaryAmount} whose value is <code>(this &times;
319-
* multiplicand)</code>, and whose scale is <code>this.scale() +
320-
* multiplicand.scale()</code>.
319+
* multiplicand)</code>, and whose scale is <code>this.getContext().getMaxScale() +
320+
* multiplicand.getContext().getMaxScale()</code>.
321321
*
322322
* @param multiplicand value to be multiplied by this {@code MonetaryAmount}.
323323
* @return {@code this * multiplicand}
@@ -328,8 +328,8 @@ default boolean isZero(){
328328

329329
/**
330330
* Returns a {@code MonetaryAmount} whose value is <code>(this &times;
331-
* multiplicand)</code>, and whose scale is <code>this.scale() +
332-
* multiplicand.scale()</code>.
331+
* multiplicand)</code>, and whose scale is <code>this.getContext().getMaxScale() +
332+
* multiplicand.getContext().getMaxScale()</code>.
333333
* By default the input value's scale will be rounded to
334334
* accommodate the format capabilities, and no {@link java.lang.ArithmeticException}
335335
* is thrown if the input number's scale exceeds the capabilities.
@@ -346,8 +346,8 @@ default boolean isZero(){
346346

347347
/**
348348
* Returns a {@code MonetaryAmount} whose value is <code>(this &times;
349-
* multiplicand)</code>, and whose scale is <code>this.scale() +
350-
* multiplicand.scale()</code>.
349+
* multiplicand)</code>, and whose scale is <code>this.getContext().getMaxScale() +
350+
* multiplicand.getContext().getMaxScale()</code>.
351351
*
352352
* @param multiplicand value to be multiplied by this {@code MonetaryAmount}. If the multiplicand's scale exceeds
353353
* the
@@ -360,8 +360,8 @@ default boolean isZero(){
360360

361361
/**
362362
* Returns a {@code MonetaryAmount} whose value is <code>this /
363-
* divisor</code>, and whose preferred scale is <code>this.scale() -
364-
* divisor.scale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
363+
* divisor</code>, and whose preferred scale is <code>this.getContext().getMaxScale() -
364+
* divisor.getContext().getMaxScale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
365365
* is thrown.
366366
*
367367
* @param divisor value by which this {@code MonetaryAmount} is to be divided.
@@ -374,8 +374,8 @@ default boolean isZero(){
374374

375375
/**
376376
* Returns a {@code MonetaryAmount} whose value is <code>this /
377-
* divisor</code>, and whose preferred scale is <code>this.scale() -
378-
* divisor.scale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
377+
* divisor</code>, and whose preferred scale is <code>this.getContext().getMaxScale() -
378+
* divisor.getContext().getMaxScale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
379379
* is thrown.
380380
*
381381
* @param divisor value by which this {@code MonetaryAmount} is to be divided.
@@ -388,8 +388,8 @@ default boolean isZero(){
388388

389389
/**
390390
* Returns a {@code MonetaryAmount} whose value is <code>this /
391-
* divisor</code>, and whose preferred scale is <code>this.scale() -
392-
* divisor.scale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
391+
* divisor</code>, and whose preferred scale is <code>this.getContext().getMaxScale() -
392+
* divisor.getContext().getMaxScale()</code>; if the exact quotient cannot be represented an {@code ArithmeticException}
393393
* is thrown.
394394
*
395395
* @param divisor value by which this {@code MonetaryAmount} is to be divided.
@@ -520,8 +520,8 @@ default boolean isZero(){
520520
/**
521521
* Returns a {@code MonetaryAmount} whose value is the integer part of the quotient
522522
* <code>this / divisor</code> rounded down. The preferred scale of the result is
523-
* <code>this.scale() -
524-
* divisor.scale()</code>.
523+
* <code>this.getContext().getMaxScale() -
524+
* divisor.getContext().getMaxScale()</code>.
525525
*
526526
* @param divisor value by which this {@code BigDecimal} is to be divided.
527527
* @return The integer part of {@code this / divisor}.
@@ -533,7 +533,7 @@ default boolean isZero(){
533533
/**
534534
* Returns a {@code MonetaryAmount} whose value is the integer part of the quotient
535535
* <code>this / divisor</code> rounded down. The preferred scale of the result is
536-
* <code>this.scale() - divisor.scale()</code>.
536+
* <code>this.getContext().getMaxScale() - divisor.getContext().getMaxScale()</code>.
537537
*
538538
* @param divisor value by which this {@code BigDecimal} is to be divided.
539539
* @return The integer part of {@code this / divisor}.
@@ -545,8 +545,8 @@ default boolean isZero(){
545545
/**
546546
* Returns a {@code MonetaryAmount} whose value is the integer part of the quotient
547547
* <code>this / divisor</code> rounded down. The preferred scale of the result is
548-
* <code>this.scale() -
549-
* divisor.scale()</code>.
548+
* <code>this.getContext().getMaxScale() -
549+
* divisor.getContext().getMaxScale()</code>.
550550
*
551551
* @param divisor value by which this {@code BigDecimal} is to be divided.
552552
* @return The integer part of {@code this / divisor}.
@@ -557,7 +557,7 @@ default boolean isZero(){
557557

558558
/**
559559
* Returns a {@code MonetaryAmount} whose numerical value is equal to ( {@code this} *
560-
* 10<sup>n</sup>). The scale of the result is <code>this.scale() - n</code>.
560+
* 10<sup>n</sup>). The scale of the result is <code>this.getContext().getMaxScale() - n</code>.
561561
*
562562
* @param power the power.
563563
* @return the calculated amount value.
@@ -569,15 +569,15 @@ default boolean isZero(){
569569

570570
/**
571571
* Returns a {@code MonetaryAmount} whose value is the absolute value of this
572-
* {@code MonetaryAmount}, and whose scale is {@code this.scale()}.
572+
* {@code MonetaryAmount}, and whose scale is {@code this.getContext().getMaxScale()}.
573573
*
574574
* @return <code>abs(this</code>
575575
*/
576576
MonetaryAmount abs();
577577

578578
/**
579579
* Returns a {@code MonetaryAmount} whose value is <code>-this</code>, and whose scale is
580-
* {@code this.scale()}, with rounding according to the context settings.
580+
* {@code this.getContext().getMaxScale()}, with rounding according to the context settings.
581581
*
582582
* @throws ArithmeticException if rounding fails.
583583
* @return {@code -this}, rounded as necessary.

src/main/java/javax/money/MonetaryContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* This class is immutable, serializable and thread-safe.
3434
*
3535
* @author Anatole Tresch
36+
* @author Werner Keil
3637
*/
3738
public final class MonetaryContext extends AbstractContext implements Serializable {
3839

@@ -44,12 +45,12 @@ public final class MonetaryContext extends AbstractContext implements Serializab
4445
static final String AMOUNT_TYPE = "amountType";
4546

4647
/**
47-
* Key name for the context.
48+
* Key name for the precision.
4849
*/
4950
private static final String PRECISION = "precision";
5051

5152
/**
52-
* Key name for the currency provider.
53+
* Key name for the fixed scale.
5354
*/
5455
private static final String FIXED_SCALE = "fixedScale";
5556

0 commit comments

Comments
 (0)