net.sf.magnitude.core
Class Stats

java.lang.Object
  extended by net.sf.magnitude.core.Stats

public final class Stats
extends java.lang.Object

Statistical operations with Magnitude objects.

Author:
Marin Lagacé

Method Summary
static Magnitude average(Magnitude[] magnitudes)
          Returns the average of the specified Magnitudes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

average

public static Magnitude average(Magnitude[] magnitudes)
Returns the average of the specified Magnitudes.

Parameters:
magnitudes - the Magnitudes to calculate the average of.
Returns:
the average of the specified Magnitudes.
Throws:
java.lang.NullPointerException - if any item of the array is null.
java.lang.IllegalArgumentException - if any Magnitude in the array has not the same units as the others.