Java Utililty Methods BigDecimal Min

List of utility methods to do BigDecimal Min

Description

The list of methods to do BigDecimal Min are organized into topic(s).

Method

BigDecimalmin(BigDecimal a, BigDecimal b)
Returns the minimum value between the two.
if (a == null)
    return b;
if (b == null)
    return a;
return a.min(b);
BigDecimalmin(BigDecimal b1, BigDecimal b2)
Return min value of @param b1 and @param b2
if (b1 == null && b2 == null) {
    return null;
if (b1 == null) {
    b1 = ZERO;
if (b2 == null) {
    b2 = ZERO;
...
BigDecimalmin(BigDecimal one, BigDecimal other)
min
return (one.compareTo(other) < 0 ? one : other);
BigDecimalmin(BigDecimal... amounts)
min
BigDecimal result = null;
for (BigDecimal bigDecimal : amounts) {
    if (bigDecimal != null) {
        result = result == null ? bigDecimal : result.min(bigDecimal);
return result;
BigDecimalmin(final BigDecimal bd1, final BigDecimal bd2)
Selects the lower of two BigDecimals, preferring the non-null value if one is null.
if (bd1 == null) {
    return bd2;
if (bd2 == null) {
    return bd1;
if (bd1.compareTo(bd2) < 0) {
    return bd1;
...
BigDecimalmin(final BigDecimal v1, final BigDecimal v2)
min
if (v1 == null) {
    return v2;
} else if (v2 == null) {
    return v1;
return v1.compareTo(v2) <= 0 ? v1 : v2;
BigDecimalmin(List numbers)
Returns the min number in the numbers list.
return new TreeSet<BigDecimal>(numbers).first();
BigDecimalminimum(BigDecimal... decimals)
Returns the smallest of the given list of decimal numbers.
BigDecimal result = null;
if (decimals != null) {
    for (BigDecimal decimal : decimals) {
        if (decimal != null) {
            if (result == null) {
                result = decimal;
            } else {
                result = result.min(decimal);
...
BigDecimalminimum(BigDecimal... values)
Calculate the minimum value from an array of values.
int len = values.length;
if (len == 1) {
    if (values[0] == null) {
        throw new IllegalArgumentException("Cannot passed null BigDecimal entry to minimum()");
    return values[0];
BigDecimal current = values[0];
...
BigDecimalminus(BigDecimal a, BigDecimal b)
compute a -b
BigDecimal bb = null;
if (null != b) {
    BigDecimal NAV_ONE = new BigDecimal(-1);
    bb = NAV_ONE.multiply(b);
return add(a, bb);