org.omnaest.utils.math
Class Average<N extends Number>

java.lang.Object
  extended by org.omnaest.utils.math.Average<N>
Type Parameters:
N -

public class Average<N extends Number>
extends Object

Average calculates average values based on a given Collection of Numbers

Author:
Omnaest

Constructor Summary
Average()
           
Average(Collection<N> numberCollection)
           
 
Method Summary
 boolean add(N e)
           
 boolean addAll(Collection<? extends N> c)
           
 BigDecimal calculate()
          Calculates the Average of the stored values
 void clear()
           
 boolean isEmpty()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Average

public Average()

Average

public Average(Collection<N> numberCollection)
Parameters:
numberCollection -
Method Detail

calculate

public BigDecimal calculate()
Calculates the Average of the stored values

Returns:

size

public int size()

isEmpty

public boolean isEmpty()

add

public boolean add(N e)

addAll

public boolean addAll(Collection<? extends N> c)

clear

public void clear()


Copyright © 2013. All Rights Reserved.