enum RoundingInverse extends Enum<RoundingInverse>
DecimalRounding
. Each constant
provides its own implementation of an invert(DecimalRounding)
method.Enum Constant and Description |
---|
ADDITIVE_REVERSION
Constant calculating inverted rounding due to sign reversion occurring
after an addition or subtraction.
|
RECIPROCAL
Constant calculating inverted rounding due to reciprocal of a value.
|
SIGN_REVERSION
Constant calculating inverted rounding due to sign reversion.
|
Modifier and Type | Method and Description |
---|---|
abstract DecimalRounding |
invert(DecimalRounding rounding)
Returns the inverted rounding for the inversion case defined by this
constant.
|
static RoundingInverse |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RoundingInverse[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RoundingInverse SIGN_REVERSION
The inverted rounding mode can be used to round a value a
instead
of the value -a
.
public static final RoundingInverse ADDITIVE_REVERSION
The inverted rounding mode can be used to round a value x
instead
of the sum (a + x)
when sum and x
have opposite sign
(equivalent for a difference (a - x)
).
public static final RoundingInverse RECIPROCAL
The inverted rounding mode can be used to round a value x
instead
of the reciprocal value 1/x
.
public static RoundingInverse[] values()
for (RoundingInverse c : RoundingInverse.values()) System.out.println(c);
public static RoundingInverse valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic abstract DecimalRounding invert(DecimalRounding rounding)
rounding
- the original rounding