Java BigDecimal Max max(List numbers)

Here you can find the source of max(List numbers)

Description

Returns the max number in the numbers list.

License

Open Source License

Parameter

Parameter Description
numbers the numbers to calculate the max.

Return

the max number in the numbers list.

Declaration

public static BigDecimal max(List<BigDecimal> numbers) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

import java.util.List;
import java.util.TreeSet;

public class Main {
    /**/*from   w w w .j ava2 s .c  o  m*/
    * Returns the max number in the numbers list.
    *
    * @param numbers the numbers to calculate the max.
    * @return the max number in the numbers list.
    */
    public static BigDecimal max(List<BigDecimal> numbers) {
        return new TreeSet<BigDecimal>(numbers).last();
    }
}

Related

  1. max(BigDecimal one, BigDecimal other)
  2. max(BigDecimal... amounts)
  3. max(BigDecimal... values)
  4. max(final BigDecimal bd1, final BigDecimal bd2)
  5. max(final List list)
  6. maximum(BigDecimal... decimals)
  7. maximum(BigDecimal... values)
  8. maxUsingFirstSignum(final BigDecimal... values)
  9. maxValue(BigDecimal origen, BigDecimal montoMaximo)