|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ge.research.utils.MathUtils
A utility class with common, useful arithmetic methods for dealing with arrays of primitive numbers and Calendar objects.
| Constructor Summary | |
MathUtils()
|
|
| Method Summary | |
static java.util.Calendar |
getMax(java.util.Calendar[] values)
Returns the max of the values of the Calendar array. |
static double |
getMax(double[] values)
Returns the max of the values of the double array. |
static float |
getMax(float[] values)
Returns the max of the values of the float array. |
static int |
getMax(int[] values)
Returns the max of the values of the int array. |
static long |
getMax(long[] values)
Returns the max of the values of the long array. |
static short |
getMax(short[] values)
Returns the max of the values of the short array. |
static float |
getMean(double[] values)
Returns the mean of the values of the double array. |
static float |
getMean(float[] values)
Returns the mean of the values of the float array. |
static float |
getMean(int[] values)
Returns the mean of the values of the int array. |
static float |
getMean(long[] values)
Returns the mean of the values of the long array. |
static float |
getMean(short[] values)
Returns the mean of the values of the short array. |
static java.util.Calendar |
getMedian(java.util.Calendar[] values)
Unimplemented method |
static double |
getMedian(double[] values)
Unimplemented method |
static float |
getMedian(float[] values)
Unimplemented method |
static double |
getMedian(int[] values)
Unimplemented method |
static double |
getMedian(long[] values)
Unimplemented method |
static double |
getMedian(short[] values)
Unimplemented method |
static java.util.Calendar |
getMin(java.util.Calendar[] values)
Returns the min of the values of the Calendar array. |
static double |
getMin(double[] values)
Returns the min of the values of the double array. |
static float |
getMin(float[] values)
Returns the min of the values of the float array. |
static int |
getMin(int[] values)
Returns the min of the values of the int array. |
static long |
getMin(long[] values)
Returns the min of the values of the long array. |
static short |
getMin(short[] values)
Returns the min of the values of the short array. |
static java.util.Calendar[] |
getMode(java.util.Calendar[] values)
Returns the Calendar array of the mode values for the Calendar array. |
static double[] |
getMode(double[] values)
Returns the double array of the mode values for the double array. |
static float[] |
getMode(float[] values)
Returns the float array of the mode values for the float array. |
static int[] |
getMode(int[] values)
Returns the int array of the mode values for the int array. |
static long[] |
getMode(long[] values)
Returns the long array of the mode values for the long array. |
static short[] |
getMode(short[] values)
Returns the short array of the mode values for the short array. |
static float |
getSum(double[] values)
Returns the sum of the values of the double array. |
static float |
getSum(float[] values)
Returns the sum of the values of the float array. |
static long |
getSum(int[] values)
Returns the sum of the values of the int array. |
static long |
getSum(long[] values)
Returns the sum of the values of the long array. |
static long |
getSum(short[] values)
Returns the sum of the values of the short array. |
static java.util.Calendar |
getVariance(java.util.Calendar[] values)
Unimplemented method |
static float |
getVariance(double[] values)
Unimplemented method |
static float |
getVariance(float[] values)
Unimplemented method |
static float |
getVariance(int[] values)
Unimplemented method |
static float |
getVariance(long[] values)
Unimplemented method |
static float |
getVariance(short[] values)
Unimplemented method |
static boolean |
hasMode(java.util.Calendar[] values)
Tests the Calendar array for a mode value. |
static boolean |
hasMode(double[] values)
Tests the double array for a mode value. |
static boolean |
hasMode(float[] values)
Tests the float array for a mode value. |
static boolean |
hasMode(int[] values)
Tests the int array for a mode value. |
static boolean |
hasMode(long[] values)
Tests the long array for a mode value. |
static boolean |
hasMode(short[] values)
Tests the short array for a mode value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MathUtils()
| Method Detail |
public static long getSum(int[] values)
throws java.lang.ArithmeticException
int array.
values - the array of values to sum
java.lang.ArithmeticException - If the running sum exceeds the maximum value for a primitive long
public static long getSum(short[] values)
throws java.lang.ArithmeticException
short array.
values - the array of values to sum
java.lang.ArithmeticException - If the running sum exceeds the maximum value for a primitive long
public static long getSum(long[] values)
throws java.lang.ArithmeticException
long array.
values - the array of values to sum
java.lang.ArithmeticException - If the running sum exceeds the maximum value for a primitive long
public static float getSum(double[] values)
throws java.lang.ArithmeticException
double array.
values - the array of values to sum
java.lang.ArithmeticException - If the running sum exceeds the maximum value for a primitive long
public static float getSum(float[] values)
throws java.lang.ArithmeticException
float array.
values - the array of values to sum
java.lang.ArithmeticException - If the running sum exceeds the maximum value for a primitive long
public static float getMean(int[] values)
throws java.lang.ArithmeticException
int array.
values - the array of values to calcualte the mean for
java.lang.ArithmeticException - If the array is of length zero, or an exception is returned computing the sum of the arraygetSum(int[])
public static float getMean(short[] values)
throws java.lang.ArithmeticException
short array.
values - the array of values to calcualte the mean for
java.lang.ArithmeticException - If the array is of length zero, or an exception is returned computing the sum of the arraygetSum(short[])
public static float getMean(long[] values)
throws java.lang.ArithmeticException
long array.
values - the array of values to calcualte the mean for
java.lang.ArithmeticException - If the array is of length zero, or an exception is returned computing the sum of the arraygetSum(long[])
public static float getMean(double[] values)
throws java.lang.ArithmeticException
double array.
values - the array of values to calcualte the mean for
java.lang.ArithmeticException - If the array is of length zero, or an exception is returned computing the sum of the arraygetSum(double[])
public static float getMean(float[] values)
throws java.lang.ArithmeticException
float array.
values - the array of values to calcualte the mean for
java.lang.ArithmeticException - If the array is of length zero, or an exception is returned computing the sum of the arraygetSum(float[])
public static int getMin(int[] values)
throws java.lang.ArithmeticException
int array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static short getMin(short[] values)
throws java.lang.ArithmeticException
short array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static long getMin(long[] values)
throws java.lang.ArithmeticException
long array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static double getMin(double[] values)
throws java.lang.ArithmeticException
double array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static float getMin(float[] values)
throws java.lang.ArithmeticException
float array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static java.util.Calendar getMin(java.util.Calendar[] values)
throws java.lang.ArithmeticException
Calendar array.
values - the array of values to calcualte the min for
java.lang.ArithmeticException - If the array is of length zero
public static int getMax(int[] values)
throws java.lang.ArithmeticException
int array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zero
public static short getMax(short[] values)
throws java.lang.ArithmeticException
short array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zero
public static long getMax(long[] values)
throws java.lang.ArithmeticException
long array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zero
public static double getMax(double[] values)
throws java.lang.ArithmeticException
double array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zero
public static float getMax(float[] values)
throws java.lang.ArithmeticException
float array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zero
public static java.util.Calendar getMax(java.util.Calendar[] values)
throws java.lang.ArithmeticException
Calendar array.
values - the array of values to calcualte the max for
java.lang.ArithmeticException - If the array is of length zeropublic static boolean hasMode(int[] values)
int array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the arraypublic static boolean hasMode(short[] values)
short array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the arraypublic static boolean hasMode(long[] values)
long array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the arraypublic static boolean hasMode(double[] values)
double array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the arraypublic static boolean hasMode(float[] values)
float array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the arraypublic static boolean hasMode(java.util.Calendar[] values)
Calendar array for a mode value.
values - the array of values to inspect for a mode
true if a mode exists for the array;
false if a mode does not exist for the array
public static int[] getMode(int[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
int array of the mode values for the int array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode array
public static short[] getMode(short[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
short array of the mode values for the short array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode array
public static long[] getMode(long[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
long array of the mode values for the long array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode array
public static double[] getMode(double[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
double array of the mode values for the double array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode array
public static float[] getMode(float[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
float array of the mode values for the float array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode array
public static java.util.Calendar[] getMode(java.util.Calendar[] values)
throws java.lang.ArithmeticException,
java.lang.Exception
Calendar array of the mode values for the Calendar array.
values - the array of values to inspect for a mode
java.lang.ArithmeticException - If the array does not have a mode
java.lang.Exception - If an internal invalid state is reached while producing the mode arraypublic static double getMedian(int[] values)
values - the array of values to calculate the median for
public static double getMedian(short[] values)
values - the array of values to calculate the median for
public static double getMedian(long[] values)
values - the array of values to calculate the median for
public static double getMedian(double[] values)
values - the array of values to calculate the median for
public static float getMedian(float[] values)
values - the array of values to calculate the median for
public static java.util.Calendar getMedian(java.util.Calendar[] values)
values - the array of values to calculate the median for
nullpublic static float getVariance(int[] values)
values - the array of values to calculate the variance for
public static float getVariance(short[] values)
values - the array of values to calculate the variance for
public static float getVariance(long[] values)
values - the array of values to calculate the variance for
public static float getVariance(double[] values)
values - the array of values to calculate the variance for
public static float getVariance(float[] values)
values - the array of values to calculate the variance for
public static java.util.Calendar getVariance(java.util.Calendar[] values)
values - the array of values to calculate the variance for
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||