public class StatisticsUtils extends Object
Constructor and Description 

StatisticsUtils() 
Modifier and Type  Method and Description 

static BigDecimal 
average(Collection<Number> numbers)
Get average calculation of various numbers as a BigDecimal.

static BigDecimal 
average(Number[] numbers)
Get average calculation of various numbers as a BigDecimal.

static BigDecimal[] 
getAllStatistics(Collection<Number> numbers)
Calculates all statistics and returns them in a
BigDecimal
numbers array. 
static BigDecimal[] 
getAllStatistics(Number[] numbers)
Calculates all statistics and returns them in a
BigDecimal
numbers array. 
static BigDecimal 
maxValue(Collection<Number> numbers)
Get the maximum value of a collection of Number elements as a
BigDecimal.

static BigDecimal 
maxValue(Number[] numbers)
Get the maximum value of an array of Number elements as a BigDecimal.

static BigDecimal 
median(Collection<Number> numbers)
Calculate median of various numbers as a BigDecimal.

static BigDecimal 
median(Number[] numbers)
Calculate median of various numbers as a BigDecimal.

static BigDecimal 
minValue(Collection<Number> numbers)
Get the minimum value of a collection of Number elements as a
BigDecimal.

static BigDecimal 
minValue(Number[] numbers)
Get the minimum value of an array of Number elements as a BigDecimal.

static BigDecimal[] 
numbersArrayToSortedBigDecimalArray(Number[] numbers)
Takes an array of numbers of any type combination and returns an array
with their BigDecimal equivalent numbers.

static BigDecimal 
quartile1(Collection<Number> numbers)
Calculate first quartile (Q1) of various numbers as a BigDecimal.

static BigDecimal 
quartile1(Number[] numbers)
Calculate first quartile (Q1) of various numbers as a BigDecimal.

static BigDecimal 
quartile3(Collection<Number> numbers)
Calculate third quartile (Q3) of various numbers as a BigDecimal.

static BigDecimal 
quartile3(Number[] numbers)
Calculate third quartile (Q3) of various numbers as a BigDecimal.

static BigDecimal 
sum(Collection<Number> numbers)
Get sum of various numbers as a BigDecimal.

static BigDecimal 
sum(Number[] numbers)
Get sum of various numbers as a BigDecimal.

public static BigDecimal average(Number[] numbers)
Null values will not be counted.
numbers
 Numbers to calculate averagepublic static BigDecimal average(Collection<Number> numbers)
Null values will not be counted.
numbers
 Numbers to calculate averagepublic static BigDecimal median(Number[] numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate medianpublic static BigDecimal median(Collection<Number> numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate medianpublic static BigDecimal quartile1(Number[] numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate Q1public static BigDecimal quartile1(Collection<Number> numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate Q1public static BigDecimal quartile3(Number[] numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate Q3public static BigDecimal quartile3(Collection<Number> numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Not null numbers to calculate Q3public static BigDecimal sum(Number[] numbers)
Null values will not be counted.
numbers
 Numbers to calculate sumpublic static BigDecimal sum(Collection<Number> numbers)
Null values will not be counted.
numbers
 Numbers to calculate sumpublic static BigDecimal minValue(Number[] numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get minpublic static BigDecimal minValue(Collection<Number> numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get minpublic static BigDecimal maxValue(Number[] numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get maxpublic static BigDecimal maxValue(Collection<Number> numbers)
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get maxpublic static BigDecimal[] getAllStatistics(Number[] numbers)
BigDecimal
numbers array.
Using this will be faster than calling all statistics separately.
Returns an array of length=8 of BigDecimal
numbers
with the results in the following order:
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get all statisticspublic static BigDecimal[] getAllStatistics(Collection<Number> numbers)
BigDecimal
numbers array.
Using this will be faster than calling all statistics separately.
Returns an array of length=8 of BigDecimal
numbers
with the results in the following order:
The elements can't be null.
The elements don't need to be sorted.
numbers
 Numbers to get all statisticspublic static BigDecimal[] numbersArrayToSortedBigDecimalArray(Number[] numbers)
numbers
 inputCopyright © 2007–2017. All rights reserved.